Setup gunicorn for production WSGI server
This commit is contained in:
parent
97d786e969
commit
e2e0144b6a
4 changed files with 14 additions and 1 deletions
|
@ -36,6 +36,8 @@ COPY --chown=website ./website ./website
|
|||
|
||||
RUN SECRET_KEY=none python manage.py collectstatic --noinput --clear -v3
|
||||
|
||||
CMD gunicorn
|
||||
|
||||
# Just dev stuff
|
||||
FROM production as dev
|
||||
|
||||
|
|
10
gunicorn.conf.py
Normal file
10
gunicorn.conf.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
import gunicorn
|
||||
|
||||
wsgi_app = "website.wsgi:application"
|
||||
accesslog = "-"
|
||||
disable_redirect_access_to_syslog = True
|
||||
preload_app = True
|
||||
bind = "0.0.0.0"
|
||||
|
||||
# Replace gunicorn's 'Server' HTTP header
|
||||
gunicorn.SERVER_SOFTWARE = "Wouldn't you like to know"
|
|
@ -11,3 +11,4 @@ wagtail-generic-chooser==0.4.1
|
|||
django-rq==2.5.1
|
||||
django-redis==5.2.0
|
||||
wagtail-draftail-snippet==0.4.1
|
||||
gunicorn==20.1.0
|
||||
|
|
|
@ -11,6 +11,6 @@ import os
|
|||
|
||||
from django.core.wsgi import get_wsgi_application
|
||||
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "website.settings.dev")
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "website.settings")
|
||||
|
||||
application = get_wsgi_application()
|
||||
|
|
Loading…
Reference in a new issue