mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-08 11:16:47 +00:00
fix(docker): gunicorn's and the job worker's output go to docker logs
They went to files in the container that were never rotated and were lost on each recreate. docker logs is rotated (10 MB x 5) and outlives a restart.
This commit is contained in:
parent
9ac1a29516
commit
5d90d3fcf9
2 changed files with 4 additions and 2 deletions
|
|
@ -3,4 +3,5 @@
|
|||
# running jobs for 60 s and exits by itself.
|
||||
cd /srv/webvirtcloud || exit
|
||||
export WEBVIRTCLOUD_LOG_FILE=/srv/webvirtcloud/data/webvirtcloud-worker.log
|
||||
exec /sbin/setuser www-data /srv/webvirtcloud/venv/bin/python3 manage.py run_worker >> /var/log/webvirtcloud-worker.log 2>&1
|
||||
# its output goes to the container's output (docker logs)
|
||||
exec /sbin/setuser www-data /srv/webvirtcloud/venv/bin/python3 manage.py run_worker 2>&1
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/sh
|
||||
# `/sbin/setuser www-data` runs the given command as the user `www-data`.
|
||||
cd /srv/webvirtcloud || exit
|
||||
exec /sbin/setuser www-data /srv/webvirtcloud/venv/bin/gunicorn webvirtcloud.wsgi:application -c /srv/webvirtcloud/gunicorn.conf.py >> /var/log/webvirtcloud.log 2>&1
|
||||
# gunicorn's own and access log go to the container's output (docker logs)
|
||||
exec /sbin/setuser www-data /srv/webvirtcloud/venv/bin/gunicorn webvirtcloud.wsgi:application -c /srv/webvirtcloud/gunicorn.conf.py 2>&1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue