Configure and use uwsgi instead of runserver.

This commit is contained in:
Christopher Grebs 2019-07-18 19:11:04 +02:00
Родитель dc5a35d33e
Коммит 8a3882a8cd
2 изменённых файлов: 34 добавлений и 1 удалений

Просмотреть файл

@ -2,7 +2,7 @@
logfile=/code/logs/supervisord.log
[program:olympia]
command=python /code/manage.py runserver 0.0.0.0:8000
command=uwsgi --ini /code/docker/uwsgi.ini
directory=/code
stopasgroup=true
autostart=true

33
docker/uwsgi.ini Normal file
Просмотреть файл

@ -0,0 +1,33 @@
# mysite_uwsgi.ini file
[uwsgi]
base = /code
chdir = %(base)
module = olympia.wsgi
# process-related settings
master = true
# maximum number of worker processes
processes = 4
socket = :8001
vacuum = true
uid = olympia
gid = olympia
# This only points to the src/ directory which should cover
# 99% of autoreload scenarios. Coverting the whole %(base) will issue
# autoreloads on new uploads etc as they're in %(base)/storage/
fs-reload = %(base)/src/
safe-pidfile = %(base)/docker/artifacts/addons-server-uwsgi-master.pid
max-requests = 5000
# Load apps in workers and not only in master
lazy-apps = true
# Open log file after we dropped privileges so that the file is being owned
# by olympia:olympia and has proper permissions to be readable outside
# of docker
logto2 = %(base)/logs/uwsgi-master.log
# Set default settings as originally done by manage.py
env = DJANGO_SETTINGS_MODULE=settings