ci: check http://192.168.1.190:3000 from runner, fix healthcheck node http
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 4s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 4s
Made-with: Cursor
This commit is contained in:
@@ -37,14 +37,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Wait for app to be healthy
|
- name: Wait for app to be healthy
|
||||||
run: |
|
run: |
|
||||||
echo "Waiting up to 180s for memento-web..."
|
echo "Waiting up to 180s for http://192.168.1.190:3000 ..."
|
||||||
for i in $(seq 1 36); 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")
|
CODE=$(curl -s -o /dev/null -w "%{http_code}" --max-time 5 http://192.168.1.190:3000/ || echo "000")
|
||||||
if [ "$STATUS" = "healthy" ]; then
|
if [ "$CODE" != "000" ] && [ "$CODE" -lt 500 ]; then
|
||||||
echo "OK - healthy after $((i * 5))s"
|
echo "OK - app responded (HTTP $CODE) after $((i * 5))s"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo " [$((i * 5))s] $STATUS"
|
echo " [$((i * 5))s] HTTP $CODE"
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
echo "Timeout! Derniers logs :"
|
echo "Timeout! Derniers logs :"
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ services:
|
|||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "wget -q --spider http://localhost:3000/ || exit 1"]
|
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/',r=>process.exit(r.statusCode<500?0:1)).on('error',()=>process.exit(1))"]
|
||||||
interval: 15s
|
interval: 15s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|||||||
Reference in New Issue
Block a user