deploy
All checks were successful
Build & Deploy KLZ Cables / build-and-deploy (push) Successful in 4m2s
All checks were successful
Build & Deploy KLZ Cables / build-and-deploy (push) Successful in 4m2s
This commit is contained in:
@@ -105,23 +105,14 @@ jobs:
|
|||||||
echo "🚀 Starting containers..."
|
echo "🚀 Starting containers..."
|
||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
|
|
||||||
echo "⏳ Waiting for health check..."
|
echo "⏳ Giving the app a few seconds to warm up..."
|
||||||
MAX_RETRIES=12
|
sleep 10
|
||||||
RETRY_COUNT=0
|
|
||||||
while [ \$RETRY_COUNT -lt \$MAX_RETRIES ]; do
|
echo "🔍 Checking container status..."
|
||||||
STATUS=\$(docker-compose ps --format "{{.Health}}" 2>/dev/null || docker-compose ps | grep klz-cablescom_app_1 | awk '{print \$NF}')
|
docker-compose ps
|
||||||
if echo "\$STATUS" | grep -q "healthy"; then
|
|
||||||
echo "✅ Service is healthy!"
|
if ! docker-compose ps | grep -q "Up"; then
|
||||||
break
|
echo "❌ Container failed to start"
|
||||||
fi
|
|
||||||
echo " • Waiting... (\$((RETRY_COUNT + 1))/\$MAX_RETRIES) Status: \$STATUS"
|
|
||||||
sleep 10
|
|
||||||
RETRY_COUNT=\$((RETRY_COUNT + 1))
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ \$RETRY_COUNT -eq \$MAX_RETRIES ]; then
|
|
||||||
echo "❌ Health check failed"
|
|
||||||
docker-compose ps
|
|
||||||
docker-compose logs --tail=100
|
docker-compose logs --tail=100
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -8,12 +8,6 @@ services:
|
|||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
healthcheck:
|
|
||||||
test: ["CMD-SHELL", "curl -f http://localhost:3000/health || exit 1"]
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 3
|
|
||||||
start_period: 60s
|
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
# HTTP ⇒ HTTPS redirect
|
# HTTP ⇒ HTTPS redirect
|
||||||
|
|||||||
Reference in New Issue
Block a user