From 333b2eff194c487af8b4dc74c197c64cf2e554cc Mon Sep 17 00:00:00 2001 From: the-dev-z Date: Wed, 12 Nov 2025 02:46:57 +0800 Subject: [PATCH] fix(docker): use curl instead of wget for better compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根據 @xqliu 建議,將 healthcheck 改用 curl 代替 wget。 Changes: - Backend healthcheck: wget → curl -f - Frontend healthcheck: wget → curl -f - 保留 frontend 使用 127.0.0.1(避免 DNS 解析問題) Benefits: - curl 在大多數 Docker 基礎鏡像中都有預裝 - wget 在某些發行版可能缺失 - curl -f 會在 HTTP 錯誤時返回非零退出碼 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0fe50998..38278f12 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,7 +25,7 @@ services: networks: - nofx-network healthcheck: - test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/api/health"] + test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"] interval: 30s timeout: 10s retries: 3 @@ -45,7 +45,7 @@ services: depends_on: - nofx healthcheck: - test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1/health"] + test: ["CMD", "curl", "-f", "http://127.0.0.1/health"] interval: 30s timeout: 10s retries: 3