diff --git a/Dockerfile b/Dockerfile index 8f8d6e8..64872c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/gunicorn.conf.py b/gunicorn.conf.py new file mode 100644 index 0000000..b52aa7c --- /dev/null +++ b/gunicorn.conf.py @@ -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" diff --git a/requirements.txt b/requirements.txt index 3696a1f..55a07c8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/website/wsgi.py b/website/wsgi.py index 63b5a1c..a51b236 100644 --- a/website/wsgi.py +++ b/website/wsgi.py @@ -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()