From 05663a6d408245f01eda2bbafededab86c21f162 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Sun, 26 Jun 2022 23:38:17 +0200 Subject: [PATCH] 8 workers --- app/asgi.sh | 3 ++- env/dev.yml | 19 +++++++++++++++++++ requirements.txt | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/app/asgi.sh b/app/asgi.sh index ec155187..487e8883 100755 --- a/app/asgi.sh +++ b/app/asgi.sh @@ -13,7 +13,8 @@ else # static files auto update # watchmedo shell-command --patterns="$patterns" --recursive \ # --command='python '$manage' collectstatic --noinput' $app & - daphne -b 0.0.0.0 -p 8000 asgi:application + # daphne -b 0.0.0.0 -p 8000 asgi:application + uvicorn asgi:application --log-level warning --workers 8 fi diff --git a/env/dev.yml b/env/dev.yml index fc5d8343..240d15b2 100644 --- a/env/dev.yml +++ b/env/dev.yml @@ -28,3 +28,22 @@ services: ports: - "9000:8000" + channels: + build: + context: . + args: + dev: 0 + command: /bin/sh /srv/app/asgi.sh + volumes: + - ./app/:/srv/app + - ./bin:/srv/bin + - ./lib:/srv/lib + - ./teleforma/:/srv/src/teleforma/teleforma + - ./var/log/app:/var/log/app + ports: + - "9002:8000" + links: + - db + - redis + env_file: + - env/staging.env diff --git a/requirements.txt b/requirements.txt index ac078ea4..84ed4a59 100644 --- a/requirements.txt +++ b/requirements.txt @@ -35,4 +35,4 @@ daphne==3.0.2 pymemcache==3.4.4 django-debug-toolbar==3.2.1 ipython -uvicorn==0.18.1 +uvicorn[standard]==0.18.1 -- 2.39.5