fix: 使用宿主机 IP 进行健康检查
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled

- 改用 172.17.16.14 替代 localhost
- 确保健康检查在 host 网络模式下正常工作
This commit is contained in:
lzh
2026-01-13 18:12:44 +08:00
parent 40c404e918
commit b3d13dacc8

View File

@@ -41,7 +41,7 @@ services:
memory: ${GATEWAY_MEMORY_LIMIT}
cpus: '1.0'
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:48080/actuator/health"]
test: ["CMD", "sh", "-c", "wget --no-verbose --tries=1 --spider http://172.17.16.14:48080/ || exit 1"]
interval: ${HEALTH_CHECK_INTERVAL}
timeout: ${HEALTH_CHECK_TIMEOUT}
retries: ${HEALTH_CHECK_RETRIES}