Updated faceai container
This commit is contained in:
parent
d500c1a1f8
commit
19f0d65896
3 changed files with 136 additions and 18 deletions
|
|
@ -84,7 +84,7 @@ The `processor` service is built from `docker/processor.Dockerfile`, which uses
|
|||
|
||||
### Persistent Logs
|
||||
|
||||
The checked-in local Compose stack now redirects the relevant Node service logs into `faceai/logs` on the host.
|
||||
The checked-in local Compose stack now mirrors the relevant Node service logs to both Docker stdout/stderr and `faceai/logs` on the host.
|
||||
|
||||
After `docker compose up --build`, inspect:
|
||||
|
||||
|
|
@ -95,6 +95,8 @@ After `docker compose up --build`, inspect:
|
|||
|
||||
This keeps the useful processor diagnostics outside the Docker-managed runtime volume so they survive container rebuilds and can be inspected directly from the workspace.
|
||||
|
||||
Because the service entrypoints now mirror output instead of redirecting it away, the same startup and runtime messages are also visible through `docker logs regalami-faceai`, `docker logs regalami-faceai-processor`, and Portainer's container log viewer.
|
||||
|
||||
The current bundled Linux `face_matcher` binary is a PyInstaller build that requires `GLIBC_2.38` or newer and the `libxcb.so.1` runtime library. The checked-in local processor image satisfies that requirement.
|
||||
|
||||
### Run The Browser Test
|
||||
|
|
@ -211,14 +213,20 @@ services:
|
|||
image: forgejo.maddoscientisto.net/maddo/faceai-client:latest
|
||||
container_name: regalami-faceai
|
||||
restart: unless-stopped
|
||||
command: sh -c "mkdir -p /data/logs && npm run start >> /data/logs/backend.log 2>&1"
|
||||
command:
|
||||
- node
|
||||
- docker/run-with-log-file.mjs
|
||||
- /data/logs/backend.log
|
||||
- npm
|
||||
- run
|
||||
- start
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
PORT: 3001
|
||||
FACEAI_FRONTEND_URL: https://ai.regalamiunsorriso.it
|
||||
FACEAI_PUBLIC_BASE_URL: https://ai.regalamiunsorriso.it
|
||||
FACEAI_LEGACY_RETURN_URL: https://www.regalamiunsorriso.it/faceai_return.php
|
||||
FACEAI_SHARED_SECRET: change-this-to-a-long-random-secret
|
||||
FACEAI_SHARED_SECRET: disagio-spaghetti-science-lol-boh
|
||||
FACEAI_SESSION_COOKIE: rus_faceai_session
|
||||
FACEAI_REDIS_URL: redis://redis:6379
|
||||
FACEAI_QUEUE_NAME: faceai-searches
|
||||
|
|
@ -228,19 +236,32 @@ services:
|
|||
FACEAI_PKL_ROOT: /data/pkl
|
||||
FACEAI_ENABLE_LOCAL_LEGACY_STATIC: 0
|
||||
volumes:
|
||||
- /var/docker/faceai/runtime:/data/runtime
|
||||
- /var/docker/faceai/logs:/data/logs
|
||||
- /mnt/storage/data/faceai/runtime:/data/runtime
|
||||
- /mnt/storage/data/faceai/logs:/data/logs
|
||||
- /mnt/nas12/nas2/RUS:/data/pkl:ro
|
||||
ports:
|
||||
- "127.0.0.1:3001:3001"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:3001/health | grep -q '\"ok\":true'"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 6
|
||||
start_period: 20s
|
||||
depends_on:
|
||||
- redis
|
||||
redis:
|
||||
condition: service_healthy
|
||||
|
||||
processor:
|
||||
image: forgejo.maddoscientisto.net/maddo/faceai-client:latest
|
||||
container_name: regalami-faceai-processor
|
||||
restart: unless-stopped
|
||||
command: sh -c "mkdir -p /data/logs && npm run start:processor >> /data/logs/processor.log 2>&1"
|
||||
command:
|
||||
- node
|
||||
- docker/run-with-log-file.mjs
|
||||
- /data/logs/processor.log
|
||||
- npm
|
||||
- run
|
||||
- start:processor
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
FACEAI_REDIS_URL: redis://redis:6379
|
||||
|
|
@ -252,18 +273,24 @@ services:
|
|||
FACEAI_WORKER_CONCURRENCY: 2
|
||||
FACEAI_WORKER_TIMEOUT_MS: 300000
|
||||
volumes:
|
||||
- /var/docker/faceai/runtime:/data/runtime
|
||||
- /var/docker/faceai/logs:/data/logs
|
||||
- /mnt/storage/data/faceai/runtime:/data/runtime
|
||||
- /mnt/storage/data/faceai/logs:/data/logs
|
||||
- /mnt/nas12/nas2/RUS:/data/pkl:ro
|
||||
- /var/docker/faceai/bin/Face_Recognition_Unix:/opt/face-recognition:ro
|
||||
- /mnt/storage/data/faceai/bin/Face_Recognition_Unix:/opt/face-recognition:ro
|
||||
depends_on:
|
||||
- redis
|
||||
redis:
|
||||
condition: service_healthy
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: regalami-faceai-redis
|
||||
restart: unless-stopped
|
||||
command: redis-server --appendonly no
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 12
|
||||
```
|
||||
|
||||
This pattern assumes a reverse proxy on the host publishes `https://ai.regalamiunsorriso.it` and forwards to `127.0.0.1:3001`. The processor is internal-only and does not expose any public port.
|
||||
|
|
@ -392,7 +419,9 @@ In the provided Docker Compose stack, that wiring is already done with:
|
|||
FACEAI_LEGACY_RETURN_URL=http://localhost:8080/faceai_return.php
|
||||
```
|
||||
|
||||
The log wiring is also already done in the checked-in Compose file with a host bind mount for `./logs:/data/logs`, so both the backend and the processor write persistent diagnostics into the workspace.
|
||||
The log wiring is also already done in the checked-in Compose file with a host bind mount for `./logs:/data/logs`, so both the backend and the processor write persistent diagnostics into the workspace while also remaining visible through Docker and Portainer container logs.
|
||||
|
||||
The Compose contract now also includes an HTTP healthcheck on the public FaceAI service and a Redis readiness check. That makes `docker compose ps` meaningful during rollout: `faceai` only becomes healthy after `GET /health` returns `{"ok":true}`, and both the public site and the processor wait for Redis readiness before their own startup sequence begins.
|
||||
|
||||
The local PHP simulator also needs the legacy bridge feature flag enabled:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue