Commit aadea7f2 authored by Georg Eisenhart's avatar Georg Eisenhart 🏈

Merge branch 'logrotate' into 'master'

kiz/bbb/management#114 logrotate config

See merge request !1
parents 66d81368 235a3de5
Pipeline #80845 passed with stage
in 25 seconds
FROM alpine:3.11
VOLUME /etc/nginx/conf.d/
VOLUME [ "/etc/nginx/conf.d/", "/etc/logrotate.d/" ]
ADD conf.d /etc/nginx/conf.d
\ No newline at end of file
ADD config/conf.d /etc/nginx/conf.d
ADD config/logrotate.d /etc/logrotate.d
CMD chmod -R 644 /etc/logrotate.d/
\ No newline at end of file
build:
docker build -t feedback-config .
run: build
docker-compose up -d
stop:
docker-compose down
\ No newline at end of file
......@@ -12,6 +12,12 @@ Nginx is configured to recieve all requests at ```/```.
By default nginx doesn't log the request body. To make this happen without any third-party plugin, nginx does an internal redirect and answers with ```200```.
The logs are stored in the format ```$remote_addr [$time_iso8601] $request_body'``` in ```/var/log/nginx/bbb-feedback.log```.
## configure logrotate
Logrotate configuration is located in ```/etc/lograotate.d/nginx```.
Logs will be rotated after an age of one week or a maximum filesize of 100M. We store the last 31 rotations.
For more information see Configuration file in ```config/logrotate.d/``` directory or ```man logrotate``` (https://linux.die.net/man/8/logrotate).
## configure BBB components
......
/var/log/nginx/*.log {
weekly
rotate 31
size 100M
missingok
compress
delaycompress
notifempty
create 644 nginx root
sharedscripts
postrotate
if [ -f /var/run/nginx.pid ]; then
kill -USR1 `cat /var/run/nginx.pid`
fi
endscript
}
version: '2'
services:
feedback:
image: nginx:1.17
image: omi-registry.e-technik.uni-ulm.de/kiz/bbb/apps/bbb-nginx
stdin_open: true
tty: true
volumes:
- feedback:/var/log/nginx/
- feedback:/var/log/nginx/ #/var/lib/docker/bbb-logs/:/var/log/nginx
volumes_from:
- feedback-config
- feedback-config:ro
labels:
name: bbb-2.novalocal
io.rancher.scheduler.affinity:host_label: name=bbb-2.novalocal
......@@ -18,4 +18,4 @@ services:
labels:
io.rancher.scheduler.affinity:host_label: name=bbb-2.novalocal
io.rancher.container.pull_image: always
io.rancher.container.start_once: 'true'
\ No newline at end of file
io.rancher.container.start_once: 'true'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment