# 0068 Keep the previous release for rollback Status: Accepted · Area: architecture · Date: 2026-10-16 · Decided by: user ## Context `tools/deploy.sh` (0067) swapped two fixed containers, `-blue` and `-green`, and removed the old release, so going back meant a full rebuild of an earlier commit. The user asked for a rollback beside the deploy. ## Decision - Name each deploy's container `-`, with its env file in `.deploy///`. - After a swap, keep the old release as a stopped container with its env folder; remove every older one. - `bash tools/rollback.sh ` stops the serving container and starts the previous one, checked against `/healthz`; a failing previous release leaves the serving one in place. Running it again rolls forward. - Deploy and rollback of one app share `.deploy//.lock`. ## Alternatives - Rebuild an earlier commit with `tools/deploy.sh`: still works for older releases, but takes a build, and the env may have changed since. - Keep more than one previous release: more disk and more env folders with secrets, for a case a checkout and deploy already covers. ## Consequences - A rollback takes seconds and builds nothing; the previous release keeps the port it was deployed with. - Containers from the blue/green script (`-blue`, `-green`) are invisible to both scripts: remove them, and `.deploy//blue` and `green`, before the first deploy with this one.