chore: drop pre-emptive 'compose down' so failed builds don't take prod offline #7
Reference in New Issue
Block a user
Delete Branch "chore/nanodrop-deploy-skip-preemptive-down"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Two-line CI fix: drop the pre-emptive
docker compose -f compose.yaml downfrom the deploy heredoc and add--remove-orphansto the survivingdocker compose -f compose.yaml up -d --build.docker compose up -d --buildbuilds the image first and only recreates (stops + replaces) the running container after a successful build. So a build failure now leaves the previous container serving traffic instead of guaranteeing a 502 from the reverse proxy.This is the 5th and final project in the cross-project
compose down→upanti-pattern audit filed on 2026-05-10. After this lands, the chore is complete:ea19e09eedf632fb04c88bd16668f3831d25a435902e30f2635f34a5fe9bed23c10109a1ca423125ecc933cbed56bbaf9c9de62675a6f870f6e473c7e0863a6c9e4fe3c98fa77b06930da3319ddabc12Concrete motivation
The 2026-05-10 buchinese outage from PR #6 (an
npm cilockfile mismatch that took prod to HTTP 502 for the entire human-intervention turnaround) is the cost being prevented: the deploy script destroyed the running container BEFORE finding out whether the new image builds. After this change a future failed build keeps the last-known-good container in place.--remove-orphansDrop-in safe: no-op when there are no orphans; cleans up old service containers when
compose.yamlis restructured (rename/remove). Same flag added to the 4 precedent workflows.Security
None.— the diff is a 1-line removal + 1-line append inside theDeploy on server with Dockerstep's ssh heredoc. No secret reads, var-interpolation patterns, SSH key handling, or auth gates touched. Net security-surface delta: zero.Test plan
docker compose ... downline removed from the deploy heredocdocker compose ... up -d --buildline gained--remove-orphansnpm run buildcleannpm test→ 126/126 passed across 18 filesrefactor:pass = noop (CI-config edit, nothing to clean up within scope)mainshould show noStopping nanodrop ...line before the build step, and a deliberately-failing build should leave the running container in place