Skip to content

Commit

Permalink
optimized Dockerfile Nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
mlodic committed Oct 12, 2022
1 parent c384022 commit 36699b5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions docker/Dockerfile_nginx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ FROM library/nginx:1.23-alpine

ENV NGINX_LOG_DIR /var/log/nginx
# this is to avoid having these logs redirected to stdout/stderr
RUN rm $NGINX_LOG_DIR/access.log $NGINX_LOG_DIR/error.log
RUN touch $NGINX_LOG_DIR/access.log $NGINX_LOG_DIR/error.log
RUN rm $NGINX_LOG_DIR/access.log $NGINX_LOG_DIR/error.log && touch $NGINX_LOG_DIR/access.log $NGINX_LOG_DIR/error.log
VOLUME /var/log/nginx

HEALTHCHECK --interval=3s --start-period=2s --timeout=2s --retries=5 CMD curl --fail http://localhost/hc || exit 1

0 comments on commit 36699b5

Please sign in to comment.