8f32d90d28
The server's compose environment: block is an allowlist — it only forwards the vars
it names. BACKUP_KEY was never added when the backup feature landed, so even though
Komodo wrote BACKUP_KEY into the Stack .env, compose dropped it and the container
came up without it (docker inspect showed JWT/SIGN present, BACKUP_KEY absent — not
empty, absent). The Backup screen correctly reported 'BACKUP_KEY missing'.
Add BACKUP_KEY: ${BACKUP_KEY:-} next to EVENT_SIGNING_KEY (optional, empty default —
backups stay off until it's set). The prod overlay only merges VISION_URL, so the
base addition flows through to prod.
Claude-Session: https://claude.ai/code/session_01Xcm6ikLgGoCxxHrxtjkk5V
61 lines
2.9 KiB
YAML
61 lines
2.9 KiB
YAML
# Base stack: the parking SERVER (API + SPA) + the VISION (ANPR) service. Branch-aware via
|
|
# ${REGISTRY}/${TAG} — a deploy on `dev` pulls :dev, on `main` pulls :main. Use an env
|
|
# override file for the environment: docker-compose.dev.yml (build locally, stub recognizer)
|
|
# or docker-compose.prod.yml (pull pinned images, fast_alpr). See
|
|
# wiki/decisions/container-deployment.md.
|
|
#
|
|
# local dev : docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build
|
|
# prod : REGISTRY=… TAG=main docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
|
|
|
|
services:
|
|
server:
|
|
image: ${REGISTRY:-git.infra.msai.al/mca/parking_solution}/parking-server:${TAG:-dev}
|
|
restart: unless-stopped
|
|
environment:
|
|
DATABASE_URL: /data/parking.sqlite
|
|
# Reach the vision service. DEV: the private compose-network service name (`vision`).
|
|
# PROD: the server runs on the HOST network (to see the booth LAN / device VLAN — it's the
|
|
# only container doing device I/O), where compose DNS doesn't resolve, so the prod override
|
|
# sets VISION_URL=http://127.0.0.1:8089 and vision publishes 8089 on the host loopback.
|
|
VISION_URL: ${VISION_URL:-http://vision:8089}
|
|
VISION_ENABLED: ${VISION_ENABLED:-1}
|
|
# JWT signing secret MUST be provided at deploy (no insecure default — see auth.ts).
|
|
JWT_SECRET: ${JWT_SECRET:?set JWT_SECRET in the env/.env}
|
|
# Dedicated ledger-signing key. Falls back to JWT_SECRET (with a warning) if empty;
|
|
# set a distinct one in prod. See apps/server/.env.example + local-jwt-auth.
|
|
EVENT_SIGNING_KEY: ${EVENT_SIGNING_KEY:-}
|
|
# Dedicated backup-ENCRYPTION key (separate from the signing key). Empty = backups stay
|
|
# off (the in-UI target + retention do nothing without it). Per-booth + unique; escrow it
|
|
# offsite. See apps/server/.env.example + wiki/concepts/backup-recovery.md.
|
|
BACKUP_KEY: ${BACKUP_KEY:-}
|
|
# CRITICAL on the plain-HTTP booth LAN: cookies are Secure (HTTPS-only) by DEFAULT,
|
|
# so without COOKIE_SECURE=0 the auth cookie is never sent over http and operators
|
|
# CANNOT LOG IN. Leave unset only behind TLS. See disk-os-hardening "deploy-time runbook".
|
|
COOKIE_SECURE: ${COOKIE_SECURE:-0}
|
|
# The booth WS live feed checks the browser Origin — must list the address operators
|
|
# actually hit (e.g. http://<booth-ip>:3000), or the live feed is rejected.
|
|
WS_ALLOWED_ORIGINS: ${WS_ALLOWED_ORIGINS:-}
|
|
volumes:
|
|
- parking-data:/data
|
|
depends_on:
|
|
vision:
|
|
condition: service_started
|
|
networks:
|
|
- parking
|
|
|
|
vision:
|
|
image: ${REGISTRY:-git.infra.msai.al/mca/parking_solution}/parking-vision:${TAG:-dev}
|
|
restart: unless-stopped
|
|
environment:
|
|
# Engine: stub (no models) by default; prod override sets fast_alpr.
|
|
VISION_RECOGNIZER: ${VISION_RECOGNIZER:-stub}
|
|
networks:
|
|
- parking
|
|
|
|
volumes:
|
|
parking-data:
|
|
|
|
networks:
|
|
parking:
|
|
driver: bridge
|