Replaced gunicorn with daphne

This commit is contained in:
Eliot Berriot 2018-03-03 10:52:48 +01:00
parent 8dea9130af
commit 7f7a62cfa2
No known key found for this signature in database
GPG Key ID: DD6965E2476E5C27
6 changed files with 13 additions and 9 deletions

3
api/compose/django/daphne.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash -eux
python /app/manage.py collectstatic --noinput
/usr/local/bin/daphne --root-path=/app -b 0.0.0.0 -p 5000 config.asgi:application

View File

@ -1,3 +0,0 @@
#!/bin/sh
python /app/manage.py collectstatic --noinput
/usr/local/bin/gunicorn config.wsgi -w 4 -b 0.0.0.0:5000 --chdir=/app

8
api/config/asgi.py Normal file
View File

@ -0,0 +1,8 @@
import django
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production")
django.setup()
from .routing import application

View File

@ -58,8 +58,6 @@ CSRF_TRUSTED_ORIGINS = ALLOWED_HOSTS
# END SITE CONFIGURATION
INSTALLED_APPS += ("gunicorn", )
# STORAGE CONFIGURATION
# ------------------------------------------------------------------------------
# Uploaded Media Files

View File

@ -21,4 +21,5 @@ RUN pip install -r /requirements/local.txt
COPY ./requirements/test.txt /requirements/test.txt
RUN pip install -r /requirements/test.txt
COPY . /app
WORKDIR /app

View File

@ -4,7 +4,4 @@
# WSGI Handler
# ------------------------------------------------
# there's no python 3 support in stable, have to use the latest release candidate for gevent
gevent==1.1rc1
gunicorn==19.4.1
daphne==2.0.4