From 2da29ea54e23ffe4a509779fd002d491b061937a Mon Sep 17 00:00:00 2001
From: Eliot Berriot <contact@eliotberriot.com>
Date: Fri, 7 Jun 2019 13:24:55 +0200
Subject: [PATCH] Deploy using uvicorn instead

---
 deploy/systemd.service | 2 +-
 setup.cfg              | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/deploy/systemd.service b/deploy/systemd.service
index 7b186f2..70470f3 100644
--- a/deploy/systemd.service
+++ b/deploy/systemd.service
@@ -6,7 +6,7 @@ After=network.target
 User=retribute
 WorkingDirectory=/srv/retribute/api
 EnvironmentFile=/srv/retribute/.env
-ExecStart=/srv/retribute/venv/bin/daphne 127.0.0.1 -p 8091 config.asgi:application --proxy-headers
+ExecStart=/srv/retribute/venv/bin/gunicorn config.asgi:application -w 4 -k uvicorn.workers.UvicornWorker -b 127.0.0.1:8091
 
 [Install]
 WantedBy=multi-user.target
diff --git a/setup.cfg b/setup.cfg
index 4155545..392b6ee 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -27,6 +27,8 @@ install_requires =
     redis
     channels
     daphne
+    gunicorn
+    uvicorn
     channels_redis
     django
     django-environ
-- 
GitLab