From 314fbd161937db9fd9cf3fbf5d2761d8e710bd84 Mon Sep 17 00:00:00 2001 From: mohamed mahmoud Date: Thu, 1 Oct 2026 11:41:11 +0300 Subject: [PATCH] fix: replace wget with node-based healthcheck in docker-compose files The node:20-bookworm-slim image used in our Dockerfile contains neither wget nor curl, causing Docker healthchecks to always fail with 'executable file not found in '. This made Docker mark the strapi container as 'unhealthy' even though it was serving correctly, which in turn caused Nginx/Cloudflare to return 502 Bad Gateway. --- docker-compose.staging.yml | 2 +- docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.staging.yml b/docker-compose.staging.yml index e76c7a0..1188eea 100644 --- a/docker-compose.staging.yml +++ b/docker-compose.staging.yml @@ -59,7 +59,7 @@ services: networks: - axe-staging-network healthcheck: - test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:1338/_health"] + test: ["CMD", "node", "-e", "const h=require('http');h.get('http://127.0.0.1:1338/_health',r=>{process.exit(r.statusCode<400?0:1)}).on('error',()=>process.exit(1))"] interval: 10s timeout: 5s retries: 10 diff --git a/docker-compose.yml b/docker-compose.yml index 35bf4eb..45c4f29 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,7 +31,7 @@ services: networks: - axe-network healthcheck: - test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:1338/_health"] + test: ["CMD", "node", "-e", "const h=require('http');h.get('http://127.0.0.1:1338/_health',r=>{process.exit(r.statusCode<400?0:1)}).on('error',()=>process.exit(1))"] interval: 30s timeout: 10s retries: 3