修改健康检查方式

This commit is contained in:
zk
2026-05-22 20:30:42 +08:00
parent 1191f85150
commit 3a1ba04ca5
3 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -19,7 +19,8 @@ RUN pnpm build
FROM nginx:alpine
ENV TZ=Asia/Shanghai
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& apk add --no-cache curl
# 拷贝构建产物
COPY --from=builder /build/dist /usr/share/nginx/html
@@ -30,6 +31,6 @@ COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD wget --spider -q http://localhost/ || exit 1
CMD curl -f http://localhost:80/ || exit 1
CMD ["nginx", "-g", "daemon off;"]