From f15a003cef9662135a8163b5d148db1573e74aa4 Mon Sep 17 00:00:00 2001 From: Felipe Coutinho Date: Sat, 25 Apr 2026 14:46:18 +0000 Subject: [PATCH] fix(docker): healthcheck usar 127.0.0.1 para hosts com IPv6 (#44) Containers em hosts com IPv6 habilitado tentavam conectar via ::1 e falhavam por timeout antes de cair no fallback IPv4. Fixar 127.0.0.1 elimina a ambiguidade. 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 14dee82..2695ff4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -109,7 +109,7 @@ USER nextjs # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ - CMD wget --quiet --tries=1 --spider http://localhost:3000/api/health || exit 1 + CMD wget --quiet --tries=1 --spider http://127.0.0.1:3000/api/health || exit 1 # Entrypoint: roda migrations e depois executa o CMD ENTRYPOINT ["/app/docker-entrypoint.sh"] diff --git a/docker-compose.yml b/docker-compose.yml index 5ce240a..edeb710 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -41,7 +41,7 @@ services: condition: service_healthy required: false healthcheck: - test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000/api/health"] + test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://127.0.0.1:3000/api/health"] interval: 30s timeout: 10s retries: 3