fix(compose): make the worker opt-in and require an explicit Supabase URL
Merged
BI
25d ago+58+58+01234567890123456789-18-18-01234567890123456789
Summary
Docker review finding: a local docker compose up with production keys in .env.local started a worker that claims from the live ingestion queue, and the app build silently defaulted NEXT_PUBLIC_SUPABASE_URL to the production project.
- Remove the production Supabase URL default (
sjrfecxgysukkwxsowpy). Compose now fails fast (${NEXT_PUBLIC_SUPABASE_URL:?...}) unless the variable is supplied. - Put
workerbehindprofiles: [worker]and drop the app'sdepends_on: worker, so a plainupstarts the app only. - Remove the obsolete
version: "3.8". env_file: [{ path: .env.local, required: false }]for both services.- Worker: set
WORKER_HEALTH_PORT=3901(internal only, nothing published; not 8080 so the Medications sibling port-isolation audit does not flag a collision) soworker/health.tsbinds, and add a Compose healthcheck on/health. - README Compose section: opt-in worker (
--profile worker), and--env-file .env.localfor bothupanddown(thedownfix came from the Qodo review bot), because${...}interpolation does not readenv_file.
Areas touched: Delivery and assurance, Knowledge and records
Verification
docker compose config -q(compose v2.39.4) with noNEXT_PUBLIC_SUPABASE_URL→required variable NEXT_PUBLIC_SUPABASE_URL is missing a value(exit 1)- With the URL set:
config --services→apponly;--profile worker config --services→app,worker; nodepends_onin the rendered config; config renders without a.env.localfile present prettier --check README.md docker-compose.yml→All matched files use Prettier code style!docs:check-links→docs link check passed;docs:check-scripts→docs script-ref check passed- Containers were not started locally (no Docker daemon on the review box).
Risk and rollout
- Risk: Low. Local Compose only. Railway does not use this file, and neither does CI.
- Rollback: Revert this PR.
- Provider or production effects: None. This reduces accidental production effects.
Notes
- Anyone who relied on
docker compose upstarting the worker must now add--profile worker, which needs connected-workload approval.