diff --git a/api/compose/django/daphne.sh b/api/compose/django/daphne.sh new file mode 100755 index 0000000000000000000000000000000000000000..16b4d50b800d8177bafe5027aa571509c0d2c149 --- /dev/null +++ b/api/compose/django/daphne.sh @@ -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 diff --git a/api/compose/django/gunicorn.sh b/api/compose/django/gunicorn.sh deleted file mode 100755 index 014f173e335808e24af6ff776d0c2cb7512978f0..0000000000000000000000000000000000000000 --- a/api/compose/django/gunicorn.sh +++ /dev/null @@ -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 \ No newline at end of file diff --git a/api/config/asgi.py b/api/config/asgi.py new file mode 100644 index 0000000000000000000000000000000000000000..b976a02ebdde045933f4a2dd1997abf2ebdadddb --- /dev/null +++ b/api/config/asgi.py @@ -0,0 +1,8 @@ +import django +import os + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production") + +django.setup() + +from .routing import application diff --git a/api/config/settings/production.py b/api/config/settings/production.py index df15d325f22d8d78616c937a3142b4a11b34ded8..f238c2d20b9e2de5a2baf8136aa7eca1f6fe40d8 100644 --- a/api/config/settings/production.py +++ b/api/config/settings/production.py @@ -58,8 +58,6 @@ CSRF_TRUSTED_ORIGINS = ALLOWED_HOSTS # END SITE CONFIGURATION -INSTALLED_APPS += ("gunicorn", ) - # STORAGE CONFIGURATION # ------------------------------------------------------------------------------ # Uploaded Media Files diff --git a/api/docker/Dockerfile.test b/api/docker/Dockerfile.test index 032b2842f37628d6f14b8cbadf95e2289cf93fb7..00638e9dd3cb5d290d336698a842f826d73583e9 100644 --- a/api/docker/Dockerfile.test +++ b/api/docker/Dockerfile.test @@ -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 diff --git a/api/requirements/production.txt b/api/requirements/production.txt index 42b66eb1535792ae0bb5a8407c0c140df1b90049..4ad8edf940dc4524f77c6ac9b339e55c7b1c5a7c 100644 --- a/api/requirements/production.txt +++ b/api/requirements/production.txt @@ -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