update health check
This commit is contained in:
@@ -84,15 +84,14 @@ jobs:
|
|||||||
# ── Migrations (runs inside the container) ──
|
# ── Migrations (runs inside the container) ──
|
||||||
docker compose exec -T waitlist alembic upgrade head
|
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..."
|
echo "Waiting for app to start..."
|
||||||
for i in 1 2 3 4 5; do
|
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 docker compose exec -T waitlist python -c "import urllib.request; urllib.request.urlopen('http://localhost:8001/health', timeout=5)" 2>/dev/null; then
|
||||||
if [ "$HTTP_CODE" -eq 200 ]; then
|
echo "✅ Waitlist service is healthy"
|
||||||
echo "✅ Waitlist service is healthy (HTTP ${HTTP_CODE})"
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo " Attempt $i: HTTP ${HTTP_CODE}, retrying..."
|
echo " Attempt $i: not ready, retrying..."
|
||||||
sleep 3
|
sleep 3
|
||||||
done
|
done
|
||||||
echo "❌ Health check failed after 5 attempts"
|
echo "❌ Health check failed after 5 attempts"
|
||||||
|
|||||||
Reference in New Issue
Block a user