From bfb733de5cef23e0fc8447648a7fa5e0cb96081d Mon Sep 17 00:00:00 2001 From: elpatron Date: Sat, 18 Apr 2026 11:17:56 +0200 Subject: [PATCH] =?UTF-8?q?fix(docker):=20Healthcheck=20=C3=BCber=20127.0.?= =?UTF-8?q?0.1=20statt=20localhost=20(IPv4/IPv6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made-with: Cursor --- Dockerfile | 2 +- docker-compose-prod.yml | 3 ++- docker-compose.yml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5145f8e..d56b558 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,7 +66,7 @@ EXPOSE 3000 # Health check HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD node -e "require('http').get('http://localhost:3000/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) })" || exit 1 + CMD node -e "require('http').get('http://127.0.0.1:3000/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) })" || exit 1 # Start the application with startup script CMD ["/app/start.sh"] diff --git a/docker-compose-prod.yml b/docker-compose-prod.yml index f87a1ba..4e147a5 100644 --- a/docker-compose-prod.yml +++ b/docker-compose-prod.yml @@ -16,8 +16,9 @@ services: - "3000:3000" volumes: - storage-data:/app/.storage + # localhost kann auf [::1] zeigen, die App lauscht aber nur auf IPv4 (0.0.0.0) → 127.0.0.1 healthcheck: - test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"] + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:3000/health"] interval: 30s timeout: 10s retries: 3 diff --git a/docker-compose.yml b/docker-compose.yml index efa8928..153dcfc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: volumes: - ./.storage:/app/.storage healthcheck: - test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/"] + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:3000/"] interval: 30s timeout: 10s retries: 3