From 3cdf06ad579b8a87f53d1284b8fd0d191b562a7d Mon Sep 17 00:00:00 2001 From: Roman Evstifeev Date: Sat, 3 Mar 2018 22:14:46 +0300 Subject: [PATCH] Automatically detect wsgi app path from django settings Increase gunicorn workers count to 4 --- src/entrypoint-web.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/entrypoint-web.sh b/src/entrypoint-web.sh index 0308b68..c7f7ab9 100755 --- a/src/entrypoint-web.sh +++ b/src/entrypoint-web.sh @@ -20,9 +20,13 @@ echo [TIMING `date +"%F %R:%S"`] Starting nginx # run main worker in current thread echo [TIMING `date +"%F %R:%S"`] Starting www workers -gunicorn "app_dir.wsgi:application" \ + +WSGI_APP=$(python -c "from django.conf import settings; print(settings.WSGI_APPLICATION[:-12])") +echo [TIMING `date +"%F %R:%S"`] Using WSGI_APP $WSGI_APP + +gunicorn "$WSGI_APP" \ --bind "0.0.0.0:8000" \ - --workers "${APP_WORKER_COUNT:-1}" \ + --workers "${APP_WORKER_COUNT:-4}" \ --log-level "info" \ --reload \ --timeout 600 \