From 233af27773b1ce6278d6c96aceab548dde1ceeb4 Mon Sep 17 00:00:00 2001 From: Dmitry Gusev Date: Sun, 10 May 2026 15:47:53 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20healthcheck=20=E2=80=94=20replace=20GNU-?= =?UTF-8?q?wget=20-I=20flag=20with=20--spider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BusyBox wget in alpine doesn't support -I flag, healthcheck was failing with 'unrecognized option' and Docker reported container as unhealthy despite nginx working correctly. Co-Authored-By: Claude Opus 4.7 --- Dockerfile | 2 +- docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index fef866c..7f0e478 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,4 +6,4 @@ COPY nginx.conf /etc/nginx/nginx.conf EXPOSE 8080 HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ - CMD wget -qO- http://127.0.0.1:8080/ -I 2>&1 | grep -q "301 Moved" || exit 1 + CMD wget -q --spider http://127.0.0.1:8080/ || exit 1 diff --git a/docker-compose.yml b/docker-compose.yml index 4cf9365..ef30682 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: ports: - "127.0.0.1:4083:8080" healthcheck: - test: ["CMD", "wget", "-qO-", "-I", "http://127.0.0.1:8080/"] + test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:8080/"] interval: 30s timeout: 5s retries: 3