Compare commits

...
This repository has been archived on 2022-10-07. You can view files and clone it, but cannot push or open issues or pull requests.

3 Commits

Author SHA1 Message Date
Karol Wypchlo be404188f3
now 2021-09-26 18:11:21 +02:00
Karol Wypchlo 11c2440ebd
rework 2021-09-26 18:06:58 +02:00
Karol Wypchlo 7e871997ea
logrotate new 2021-09-26 17:19:15 +02:00
2 changed files with 18 additions and 0 deletions

View File

@ -1,6 +1,8 @@
FROM openresty/openresty:1.19.9.1-bionic
RUN luarocks install lua-resty-http && \
apt-get update -qq && \
apt-get install cron logrotate -qq && \
openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 \
-subj '/CN=local-certificate' \
-keyout /etc/ssl/local-certificate.key \
@ -9,11 +11,14 @@ RUN luarocks install lua-resty-http && \
COPY mo ./
COPY conf.d /etc/nginx/conf.d
COPY conf.d.templates /etc/nginx/conf.d.templates
COPY logrotate /etc/logrotate.d/nginx
CMD [ "bash", "-c", \
"./mo < /etc/nginx/conf.d.templates/server.account.conf > /etc/nginx/conf.d/server.account.conf ; \
./mo < /etc/nginx/conf.d.templates/server.api.conf > /etc/nginx/conf.d/server.api.conf; \
./mo < /etc/nginx/conf.d.templates/server.hns.conf > /etc/nginx/conf.d/server.hns.conf; \
./mo < /etc/nginx/conf.d.templates/server.skylink.conf > /etc/nginx/conf.d/server.skylink.conf ; \
mv /etc/cron.daily/logrotate /etc/cron.hourly/logrotate ; \
/usr/sbin/service cron start ; \
/usr/local/openresty/bin/openresty '-g daemon off;'" \
]

13
docker/nginx/logrotate Normal file
View File

@ -0,0 +1,13 @@
/usr/local/openresty/nginx/logs/*.log {
hourly
dateext
rotate 3650
missingok
notifempty
nocompress
create 644 root root
sharedscripts
postrotate
/usr/local/openresty/bin/openresty -s reopen
endscript
}