ci: fix healthcheck (use wget), increase timeout to 180s
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 3m13s
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 3m13s
Made-with: Cursor
This commit is contained in:
@@ -37,8 +37,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Wait for app to be healthy
|
- name: Wait for app to be healthy
|
||||||
run: |
|
run: |
|
||||||
echo "Waiting up to 120s for memento-web..."
|
echo "Waiting up to 180s for memento-web..."
|
||||||
for i in $(seq 1 24); do
|
for i in $(seq 1 36); do
|
||||||
STATUS=$(ssh root@192.168.1.190 "docker inspect --format='{{.State.Health.Status}}' memento-web 2>/dev/null || echo unknown")
|
STATUS=$(ssh root@192.168.1.190 "docker inspect --format='{{.State.Health.Status}}' memento-web 2>/dev/null || echo unknown")
|
||||||
if [ "$STATUS" = "healthy" ]; then
|
if [ "$STATUS" = "healthy" ]; then
|
||||||
echo "OK - healthy after $((i * 5))s"
|
echo "OK - healthy after $((i * 5))s"
|
||||||
@@ -48,7 +48,7 @@ jobs:
|
|||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
echo "Timeout! Derniers logs :"
|
echo "Timeout! Derniers logs :"
|
||||||
ssh root@192.168.1.190 "docker logs memento-web --tail=30"
|
ssh root@192.168.1.190 "docker logs memento-web --tail=50"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
|
|||||||
@@ -46,11 +46,11 @@ services:
|
|||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "node", "-e", "fetch('http://localhost:3000').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
|
test: ["CMD-SHELL", "wget -q --spider http://localhost:3000/ || exit 1"]
|
||||||
interval: 30s
|
interval: 15s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 3
|
retries: 5
|
||||||
start_period: 40s
|
start_period: 60s
|
||||||
networks:
|
networks:
|
||||||
- memento-network
|
- memento-network
|
||||||
deploy:
|
deploy:
|
||||||
|
|||||||
Reference in New Issue
Block a user