fix(deploy): update healthcheck URL to use localhost

The healthcheck URL was updated from using the environment variable NGINX_CONFIG_URL to using 127.0.0.1 to ensure the healthcheck works correctly in the local environment. This change avoids potential issues with the environment variable not being properly resolved.
This commit is contained in:
danial
2025-03-30 00:36:11 +08:00
parent 3d13780d46
commit fe1c0d69ff

View File

@@ -28,6 +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://${NGINX_CONFIG_URL}:12401/api/monitor/heathcheck || exit 1
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD curl -f http://127.0.0.1:12400/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