fix(ci): use retry loop for frontend health check
Some checks failed
Deploy to Production / deploy (push) Failing after 3m32s
Some checks failed
Deploy to Production / deploy (push) Failing after 3m32s
The frontend container needs more time to initialize. Replace fixed sleep with a retry loop that polls the container health status up to 30 times (150s max) before checking. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f43f26f43c
commit
e22241dbc4
@ -42,8 +42,15 @@ jobs:
|
||||
|
||||
- name: Health check
|
||||
run: |
|
||||
echo "Waiting for services to start..."
|
||||
sleep 20
|
||||
echo "Waiting for all containers to become healthy..."
|
||||
for i in $(seq 1 30); do
|
||||
STATUS=$(docker inspect --format='{{.State.Health.Status}}' galaxis-po-frontend 2>/dev/null || echo "missing")
|
||||
if [ "$STATUS" = "healthy" ]; then
|
||||
break
|
||||
fi
|
||||
echo " frontend: $STATUS (attempt $i/30)"
|
||||
sleep 5
|
||||
done
|
||||
docker compose --project-name galaxis-po --env-file .env.prod -f docker-compose.prod.yml ps
|
||||
docker exec galaxis-po-backend python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')" || { echo "Backend: FAILED"; exit 1; }
|
||||
echo "Backend: OK"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user