fix logrotate

This commit is contained in:
Karol Wypchlo 2021-01-25 11:09:27 +01:00
parent 9e67cd1c88
commit 0553a067b8
2 changed files with 5 additions and 1 deletions

View File

@ -64,12 +64,12 @@ services:
container_name: nginx
restart: unless-stopped
logging: *default-logging
user:
env_file:
- .env
volumes:
- ./docker/nginx/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf:ro
- ./docker/nginx/conf.d:/etc/nginx/conf.d:ro
- ./docker/nginx/logrotate:/etc/logrotate.d/nginx:ro
- ./docker/data/nginx/cache:/data/nginx/cache
- ./docker/data/nginx/logs:/usr/local/openresty/nginx/logs
- ./docker/data/nginx/skynet:/data/nginx/skynet:ro

View File

@ -6,4 +6,8 @@ RUN luarocks install luasocket
# change "syslog" user to "adm" user in logrotate.conf
RUN sed -i 's/^su root syslog/su root adm/' /etc/logrotate.conf
# copy nginx logrotate config and assign correct owner
COPY ./logrotate /etc/logrotate.d/nginx
RUN chown root:root /etc/logrotate.d/nginx
CMD ["sh", "-c", "service cron start ; /usr/local/openresty/bin/openresty -g 'daemon off;'"]