Commit graph

1 commit

Author SHA1 Message Date
DJP
e223122abe Drop db-v2 host port binding in prod; add port pre-flight to cutover script
The host port 5437 on the optical-dev server was already allocated by
something (probably an old stopped-but-not-removed Postgres container
or another tracking app). V2 doesn't need a host port for db-v2 in
production — app-v2 reaches it over the docker network at db-v2:5432.

Per CLAUDE.md "always check for ports that are already used":

- docker-compose.v2.yml: remove the unconditional db-v2 host port
  binding. Compose's list-merge semantics meant `ports: []` in the prod
  override didn't actually clear the base list.
- docker-compose.v2.dev.yml (new): local-dev overlay that re-adds the
  host port for psql convenience. Use with `-f base -f dev`. Bound to
  127.0.0.1 so the db is never reachable from outside the dev machine.
- cutover-in-place.sh: pre-flight check on APP_V2_PORT (3457) — if
  it's held by something other than our own V2 container, abort with
  a clear message rather than failing mid-deploy.

Verified locally: `compose -f base -f prod up -d` brings up a stack
with db-v2 having no host port (just internal 5432/tcp), app-v2 on
127.0.0.1:3457, /api/health returns {ok:true}.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 18:49:44 -04:00