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:
parent
872efc74ce
commit
a16ccdcef4
1 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue