diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 9baf0b4..cffd8b4 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -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"