diff --git a/Dockerfile b/Dockerfile index c4e17bb..c4dbf17 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,14 @@ -FROM nginx:1.21.0 +FROM nginx:1.23.2-alpine # Remove sym links from nginx image RUN rm /var/log/nginx/access.log RUN rm /var/log/nginx/error.log # Install logrotate -RUN apt-get update && apt-get -y install logrotate && apt-get -y install vim +RUN apk update && apk add logrotate vim COPY crontab /etc/crontab +COPY nginx-logrotate /etc/logrotate.d/nginx # Start nginx and cron as a service -CMD service cron start && nginx -g 'daemon off;' +CMD crond -b && nginx -g 'daemon off;' diff --git a/docker-compose-local.yml b/docker-compose-local.yml index 18ae7ed..fdad3e4 100644 --- a/docker-compose-local.yml +++ b/docker-compose-local.yml @@ -6,7 +6,4 @@ services: image: proxynginx:latest restart: "no" ports: - - 80:80 - volumes: - - ./log:/var/log/nginx - - ./nginx-logrotate:/etc/nginx-logrotate + - 8080:80