update health check
All checks were successful
Test & Deploy Waitlist / test (push) Successful in 34s
Test & Deploy Waitlist / deploy (push) Successful in 16s

This commit is contained in:
Roberto Musso
2026-04-11 17:42:54 +02:00
parent 2e92bee410
commit 7553a0c02b

View File

@@ -84,15 +84,14 @@ jobs:
# ── Migrations (runs inside the container) ──
docker compose exec -T waitlist alembic upgrade head
# ── Health check (curl with correct Host header for Caddy) ──
# ── Health check (directly inside the waitlist container) ──
echo "Waiting for app to start..."
for i in 1 2 3 4 5; do
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -H "Host: adiuvai.com" http://localhost:80/health)
if [ "$HTTP_CODE" -eq 200 ]; then
echo "✅ Waitlist service is healthy (HTTP ${HTTP_CODE})"
if docker compose exec -T waitlist python -c "import urllib.request; urllib.request.urlopen('http://localhost:8001/health', timeout=5)" 2>/dev/null; then
echo "✅ Waitlist service is healthy"
exit 0
fi
echo " Attempt $i: HTTP ${HTTP_CODE}, retrying..."
echo " Attempt $i: not ready, retrying..."
sleep 3
done
echo "❌ Health check failed after 5 attempts"