From 445ed8892f311680aee277cfb275f3ac8a742b7c Mon Sep 17 00:00:00 2001 From: nlevesque Date: Tue, 28 Jul 2026 13:03:51 +0200 Subject: [PATCH] Add healthchecks: app checks /login (200), pocketbase checks /api/health Coolify's default healthcheck hits / expecting 200, but the app answers 302 (redirect to /login), which marked the stack exited:unhealthy and stopped it. app also now waits for pocketbase to be healthy. --- docker-compose.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 02a97e1..4547532 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,6 +24,12 @@ services: SMTP_SENDER_ADDRESS: ${SMTP_SENDER_ADDRESS:-} volumes: - pb_data:/pb/pb_data + healthcheck: + test: "curl -fsS http://localhost:8090/api/health || exit 1" + interval: 30s + timeout: 5s + retries: 5 + start_period: 15s app: build: . @@ -33,7 +39,15 @@ services: # directly, everything goes through the Astro server. POCKETBASE_URL: http://pocketbase:8090 depends_on: - - pocketbase + pocketbase: + condition: service_healthy + healthcheck: + # / redirects to /login (302) — check a 200 endpoint instead + test: "wget -q -O /dev/null http://localhost:4321/login || exit 1" + interval: 30s + timeout: 5s + retries: 5 + start_period: 15s volumes: pb_data: