moved config steps into separate scripts
All checks were successful
All checks were successful
This commit is contained in:
24
rootfs/app/entrypoint.sh.d/90_logs.sh
Executable file
24
rootfs/app/entrypoint.sh.d/90_logs.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "# Configuring logrotate"
|
||||
|
||||
# make sure path exists
|
||||
mkdir -p "${PATH_LOGS}"
|
||||
chown -R "${USERNAME}:${GROUPNAME}" "${PATH_LOGS}"
|
||||
|
||||
# configure logrotate
|
||||
cat >/etc/logrotate.d/nginx <<EOF
|
||||
${PATH_LOGS}/nginx-access.log {
|
||||
missingok
|
||||
daily
|
||||
rotate ${LOG_DAYS}
|
||||
compress
|
||||
delaycompress
|
||||
sharedscripts
|
||||
su ${USERNAME} ${GROUPNAME}
|
||||
postrotate
|
||||
/usr/sbin/nginx -s reopen
|
||||
nice -n 19 /usr/bin/goaccess ${PATH_LOGS}/nginx-access.log.1 --agent-list --anonymize-ip --real-os --output ${PATH_STATS}/index.html --log-format COMBINED --tz="${TZ}" --db-path=${PATH_STATSDB} --persist --restore
|
||||
endscript
|
||||
}
|
||||
EOF
|
||||
Reference in New Issue
Block a user