deploy
Some checks failed
Build & Deploy KLZ Cables / build-and-deploy (push) Failing after 5m55s

This commit is contained in:
2026-01-29 13:57:35 +01:00
parent 2aa5d5b00e
commit 658057cdb1
2 changed files with 22 additions and 12 deletions

View File

@@ -103,16 +103,26 @@ jobs:
docker-compose down
echo "🚀 Starting containers..."
if ! docker-compose up -d --wait 2>/dev/null; then
docker-compose up -d
echo "⏳ Waiting for health check..."
sleep 15
fi
docker-compose up -d
echo "⏳ Waiting for health check..."
MAX_RETRIES=12
RETRY_COUNT=0
while [ \$RETRY_COUNT -lt \$MAX_RETRIES ]; do
STATUS=\$(docker-compose ps --format "{{.Health}}" 2>/dev/null || docker-compose ps | grep klz-cablescom_app_1 | awk '{print \$NF}')
if echo "\$STATUS" | grep -q "healthy"; then
echo "✅ Service is healthy!"
break
fi
echo " • Waiting... (\$((RETRY_COUNT + 1))/\$MAX_RETRIES) Status: \$STATUS"
sleep 10
RETRY_COUNT=\$((RETRY_COUNT + 1))
done
if ! docker-compose ps | grep -q "healthy"; then
if [ \$RETRY_COUNT -eq \$MAX_RETRIES ]; then
echo "❌ Health check failed"
docker-compose ps
docker-compose logs --tail=50
docker-compose logs --tail=100
exit 1
fi

View File

@@ -9,11 +9,11 @@ services:
env_file:
- .env
healthcheck:
test: ["CMD-SHELL", "curl -f http://127.0.0.1:3000/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
test: ["CMD-SHELL", "curl -f http://localhost:3000/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
labels:
- "traefik.enable=true"
# HTTP ⇒ HTTPS redirect