Skip to content

fix: replace wget with node-based healthcheck in docker-compose - #13

Merged
mohamed-ctrl878 merged 1 commit into
mainfrom
fix/docker-healthcheck
Oct 1, 2026
Merged

mohamed-ctrl878 merged 1 commit into
mainfrom
fix/docker-healthcheck

Conversation

@mohamed-ctrl878

Copy link
Copy Markdown
Owner

Problem

The node:20-bookworm-slim Docker image used in our Dockerfile contains neither wget nor curl. This caused the Docker healthcheck to always fail with:

exec: "wget": executable file not found in $PATH

Docker marked the strapi container as unhealthy even though it was serving HTTP 204 correctly on /_health. This caused Nginx/Cloudflare to intermittently return 502 Bad Gateway.

Fix

Replaced wget with a node -e one-liner that uses Node.js's built-in http module (always available in the container) to check the health endpoint.

Files Changed

  • docker-compose.yml — production healthcheck
  • docker-compose.staging.yml — staging healthcheck

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.
@mohamed-ctrl878
mohamed-ctrl878 merged commit 314fbd1 into main Oct 1, 2026
4 checks passed
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

✅ Pipeline Results

Stage Status
🧪 Unit Tests ✅ Passed
📦 Build ✅ Passed

Deploy: Will run automatically after merge to main.

📋 View Full Logs

This branch had an error being deployed

1 failed deployment
staging-e2e — 314fbd16 Deployed Oct 1, 2026 by mohamed-ctrl878 via staging-e2e #21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant