Skip to content

Commit 91f11da

Browse files
committed
屏蔽无用的nginx日志,增加健康检查wq
1 parent fdc5aba commit 91f11da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RUN pwd && ls -a
1515
# glibc env run
1616
FROM nginx:latest
1717

18-
RUN mkdir -p /ServerStatus/server/
18+
RUN mkdir -p /ServerStatus/server/ && ln -sf /dev/null /var/log/nginx/access.log && ln -sf /dev/null /var/log/nginx/error.log
1919

2020
COPY --from=builder server /ServerStatus/server/
2121
COPY --from=builder web /usr/share/nginx/html/
@@ -25,5 +25,5 @@ ENV TZ=Asia/Shanghai
2525
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
2626

2727
EXPOSE 80 35601
28-
28+
HEALTHCHECK --interval=5s --timeout=3s --retries=3 CMD curl --fail http://localhost:80 || bash -c 'kill -s 15 -1 && (sleep 10; kill -s 9 -1)'
2929
CMD nohup sh -c '/etc/init.d/nginx start && /ServerStatus/server/sergate --config=/ServerStatus/server/config.json --web-dir=/usr/share/nginx/html'

0 commit comments

Comments
 (0)