feat: 添加 Docker 健康检查配置,监控后端服务状态

This commit is contained in:
danial
2025-02-24 22:45:03 +08:00
parent 9b7de2bd74
commit a85f21933f

View File

@@ -28,7 +28,6 @@ RUN sed -i "s#NGINX_CONFIG_URL#${NGINX_CONFIG_URL}#g" /etc/nginx/conf.d/default.
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
# 添加安全检查
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD curl -f http://kami_backend:12401/api/monitor/heathcheck || exit 1
# CMD ["nginx", "/etc/nginx/conf.d/default.conf"]
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD curl -f http://${NGINX_CONFIG_URL}:12401/api/monitor/heathcheck || exit 1
# CMD ["sed", "-i", "'s#NGINX_CONFIG_URL#${NGINX_CONFIG_URL}#g'", "/etc/nginx/conf.d/default.conf && nginx ", "-g", "'daemon off;'"]
EXPOSE 12400