fix(ci): resolve docker compose race condition in prod deployment
Some checks failed
Release / Test UI (push) Successful in 54s
Release / Test backend (push) Successful in 6m46s
Release / Deploy to prod (push) Has been cancelled
Release / Deploy to homelab (push) Has been cancelled
Release / Gitea Release (push) Has been cancelled
Release / Build and push images (push) Has been cancelled

Stop containers explicitly before pulling + restarting to prevent the
'No such container' race condition where Docker Compose tries to start
a new container while simultaneously removing the old one.

Also remove --no-deps flag which caused stale hash-prefixed container
names (e.g. 41cb964156c0_libnovel-ui-1) that trigger the race.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Admin
2026-04-17 23:08:22 +05:00
parent a53e754715
commit 75bfff5a74

View File

@@ -130,7 +130,8 @@ jobs:
'set -euo pipefail
cd /opt/libnovel
doppler run -- docker compose pull backend runner ui caddy pocketbase
doppler run -- docker compose up -d --no-deps --remove-orphans backend runner ui caddy pocketbase'
doppler run -- docker compose stop backend runner ui caddy pocketbase
doppler run -- docker compose up -d --remove-orphans backend runner ui caddy pocketbase'
# ── deploy homelab runner ─────────────────────────────────────────────────────
# Syncs the homelab runner compose file and restarts the runner service.