修改健康检查方式
This commit is contained in:
+3
-2
@@ -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;"]
|
||||
|
||||
Reference in New Issue
Block a user