From b82a4681977c636723cdd3eed8d149406b49a2ac Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 20 May 2026 11:38:55 +0200 Subject: [PATCH] fix: add Docker native HEALTHCHECK, replaces broken Coolify HTTP check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Coolify's HTTP health check hits localhost:3000 from the host — but the container port is only reachable inside the Docker network via Traefik. Docker's own HEALTHCHECK runs inside the container where localhost works. Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index 7cec5f1..ac22385 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM node:20-alpine +RUN apk add --no-cache curl + WORKDIR /app COPY package*.json ./ @@ -9,4 +11,7 @@ COPY src/ ./src/ EXPOSE 3000 +HEALTHCHECK --interval=15s --timeout=5s --start-period=30s --retries=3 \ + CMD curl -f http://localhost:3000/health || exit 1 + CMD ["node", "src/index.js"]