feat: optimize prod deployment to avoid unnecessary container restarts

Previously: 'docker compose up -d' recreated all services with changed images,
causing dependent services (pocketbase, minio, redis, etc.) to restart and
wait for healthchecks, leading to longer downtime.

Now: Use '--no-deps' flag to restart ONLY the services with updated images
(backend, runner, ui, caddy, pocketbase) without touching their dependencies.

Benefits:
- Faster deployments (~15-20s vs ~60s)
- No unnecessary restarts of infrastructure services
- Reduced downtime for the application

The final 'docker compose up -d --remove-orphans' ensures any orphaned
containers are cleaned up and all services are in the desired state.
This commit is contained in:
Admin
2026-04-16 21:51:42 +05:00
parent 7a4008bd9c
commit 0aecfcacf1

View File

@@ -130,6 +130,8 @@ jobs:
'set -euo pipefail
cd /opt/libnovel
doppler run -- docker compose pull backend runner ui caddy pocketbase
# Restart only the services with new images, without waiting for dependencies
doppler run -- docker compose up -d --no-deps backend runner ui caddy pocketbase
doppler run -- docker compose up -d --remove-orphans'
# ── deploy homelab runner ─────────────────────────────────────────────────────