fix(infrastructure): don't let a slow/unhealthy api block deploy
Portainer's compose up blocks on frontend's api: condition: service_healthy dependency and, on timeout, tears down everything it just created - so an unhealthy api container never stuck around long enough to pull logs from. Relaxed to service_started (frontend doesn't need api ready at container-start), and gave the api healthcheck more runway (60s start_period, 10 retries @ 10s) in case it's just slow to boot rather than crashing.
This commit is contained in:
@@ -46,10 +46,10 @@ services:
|
||||
condition: service_completed_successfully
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget -qO- http://localhost:3001/api/v1/health || exit 1"]
|
||||
interval: 15s
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
retries: 10
|
||||
start_period: 60s
|
||||
networks:
|
||||
- app-network
|
||||
- proxy
|
||||
@@ -95,8 +95,11 @@ services:
|
||||
- "traefik.http.routers.studioflow-frontend.priority=1"
|
||||
- "traefik.http.services.studioflow-frontend.loadbalancer.server.port=3000"
|
||||
depends_on:
|
||||
# service_started, not service_healthy: a slow/unhealthy api shouldn't block the
|
||||
# whole `compose up` (and Portainer tearing down what it created) - the frontend
|
||||
# itself doesn't need api to be ready at container-start time.
|
||||
api:
|
||||
condition: service_healthy
|
||||
condition: service_started
|
||||
networks:
|
||||
- app-network
|
||||
- proxy
|
||||
|
||||
Reference in New Issue
Block a user