- 将健康检查命令从`/photography-api --health-check`更新为使用新的脚本`/usr/local/bin/health-check.sh` - 在Dockerfile中添加`wget`作为运行时依赖 - 确保健康检查脚本具有执行权限 此更改提升了健康检查的可靠性和灵活性。
This commit is contained in:
12
backend/health-check.sh
Executable file
12
backend/health-check.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
# 健康检查脚本
|
||||
# 用于Docker健康检查和Kubernetes探针
|
||||
|
||||
# 检查健康检查端点
|
||||
if wget --no-verbose --tries=1 --spider http://localhost:8080/api/v1/health; then
|
||||
echo "Health check passed"
|
||||
exit 0
|
||||
else
|
||||
echo "Health check failed"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user