Fix docker compose up blocking on frontend healthcheck
- frontend depends_on: service_started (not service_healthy) — docker compose up -d now returns once containers start, not after full health chain resolves - frontend healthcheck: use node HTTP check (wget/curl not in alpine runner) - start_period: 60s (Next.js can take time on first request) - on_error: show 60 log lines instead of 30 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
bf3b19fcb9
commit
954e05e01e
2 changed files with 4 additions and 4 deletions
|
|
@ -76,14 +76,14 @@ services:
|
|||
NEXT_PUBLIC_WS_URL: "wss://ai-sandbox.oliver.solutions/notebookllama-back"
|
||||
depends_on:
|
||||
backend:
|
||||
condition: service_healthy
|
||||
condition: service_started
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget -qO- http://localhost:4000/notebookllama || exit 1"]
|
||||
test: ["CMD-SHELL", "node -e \"require('http').get('http://localhost:4000/notebookllama', r => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))\""]
|
||||
interval: 20s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 30s
|
||||
start_period: 60s
|
||||
|
||||
jaeger:
|
||||
image: jaegertracing/all-in-one:latest
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ done
|
|||
on_error() {
|
||||
local code=$?
|
||||
fail "Deploy failed (exit $code at line ${BASH_LINENO[0]})"
|
||||
docker compose -f "${REPO_DIR}/docker-compose.yml" logs --tail=30 2>/dev/null || true
|
||||
docker compose -f "${REPO_DIR}/docker-compose.yml" logs --tail=60 2>/dev/null || true
|
||||
exit $code
|
||||
}
|
||||
trap on_error ERR
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue