fix: build images before tearing down compose to reduce downtime

Old behaviour: compose down → long build → compose up
New behaviour: long build (service stays live) → compose down → compose up

Downtime is now limited to the few seconds of the swap instead of the
entire duration of the Rust/image build.

https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH
This commit is contained in:
Claude 2026-03-24 10:43:36 +00:00
parent 872efc74ce
commit a16ccdcef4
No known key found for this signature in database

View file

@ -177,8 +177,9 @@ for i in 1 2 3 4 5; do
done done
[ -S "$PODMAN_SOCK" ] || { echo "ERROR: Podman socket did not appear"; exit 1; } [ -S "$PODMAN_SOCK" ] || { echo "ERROR: Podman socket did not appear"; exit 1; }
# ── Build images ─────────────────────────────────────────────────────────────── # ── Build images (while the old stack is still running) ───────────────────────
make -C "$SCRIPT_DIR" build make -C "$SCRIPT_DIR" build
# ── Start services (detached) ────────────────────────────────────────────────── # ── Swap to new images (brief downtime starts here) ────────────────────────────
podman compose --env-file "$REPO_ROOT/.env" -f "$SCRIPT_DIR/docker-compose.yml" down
podman compose --env-file "$REPO_ROOT/.env" -f "$SCRIPT_DIR/docker-compose.yml" up -d podman compose --env-file "$REPO_ROOT/.env" -f "$SCRIPT_DIR/docker-compose.yml" up -d