ci: check backend/frontend via docker status in runner container mode
All checks were successful
Deploy to Production / deploy (push) Successful in 24s

This commit is contained in:
codex
2026-03-11 17:49:13 +08:00
parent 00469941dd
commit aeb7a8b678

View File

@@ -58,13 +58,14 @@ jobs:
- name: Wait for backend health check - name: Wait for backend health check
run: | run: |
echo "Waiting for backend to be healthy..." echo "Waiting for backend container health=healthy..."
for i in $(seq 1 30); do for i in $(seq 1 30); do
if curl -sf http://127.0.0.1:18000/api/v1/utils/health-check/ > /dev/null 2>&1; then status=$(docker inspect -f '{{.State.Health.Status}}' full-stack-fastapi-backend-1 2>/dev/null || echo "unknown")
if [ "$status" = "healthy" ]; then
echo "✅ Backend is healthy!" echo "✅ Backend is healthy!"
exit 0 exit 0
fi fi
echo "Attempt $i/30 - waiting 10s..." echo "Attempt $i/30 - status=$status, waiting 10s..."
sleep 10 sleep 10
done done
echo "❌ Backend health check failed after 300s" echo "❌ Backend health check failed after 300s"
@@ -73,7 +74,7 @@ jobs:
- name: Verify frontend - name: Verify frontend
run: | run: |
if curl -sf http://127.0.0.1:3001 > /dev/null 2>&1; then if docker compose --env-file .env.production -f compose.prod.yml ps frontend --status running | grep -q frontend; then
echo "✅ Frontend is accessible!" echo "✅ Frontend is accessible!"
else else
echo "❌ Frontend is not accessible" echo "❌ Frontend is not accessible"