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.
This commit is contained in:
+15
-1
@@ -24,6 +24,12 @@ services:
|
|||||||
SMTP_SENDER_ADDRESS: ${SMTP_SENDER_ADDRESS:-}
|
SMTP_SENDER_ADDRESS: ${SMTP_SENDER_ADDRESS:-}
|
||||||
volumes:
|
volumes:
|
||||||
- pb_data:/pb/pb_data
|
- 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:
|
app:
|
||||||
build: .
|
build: .
|
||||||
@@ -33,7 +39,15 @@ services:
|
|||||||
# directly, everything goes through the Astro server.
|
# directly, everything goes through the Astro server.
|
||||||
POCKETBASE_URL: http://pocketbase:8090
|
POCKETBASE_URL: http://pocketbase:8090
|
||||||
depends_on:
|
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:
|
volumes:
|
||||||
pb_data:
|
pb_data:
|
||||||
|
|||||||
Reference in New Issue
Block a user