diff --git a/compose/local/django/start b/compose/local/django/start index 4eaa76436..252b99752 100755 --- a/compose/local/django/start +++ b/compose/local/django/start @@ -11,5 +11,11 @@ python manage.py migrate if [ "${DEBUGGER:-0}" = "1" ]; then exec python -Xfrozen_modules=off -m debugpy --listen 0.0.0.0:5678 -m uvicorn config.asgi:application --host 0.0.0.0 else - exec uvicorn config.asgi:application --host 0.0.0.0 --reload --reload-include '*.html' + WORKERS="${WEB_WORKERS:-1}" + if [ "$WORKERS" -gt 1 ]; then + # --reload is incompatible with --workers, so skip it for multi-worker mode + exec uvicorn config.asgi:application --host 0.0.0.0 --workers "$WORKERS" + else + exec uvicorn config.asgi:application --host 0.0.0.0 --reload --reload-include '*.html' + fi fi diff --git a/compose/production/django/start b/compose/production/django/start index 5dcb00b5a..a775c0527 100644 --- a/compose/production/django/start +++ b/compose/production/django/start @@ -6,4 +6,6 @@ set -o nounset python /app/manage.py collectstatic --noinput -exec newrelic-admin run-program /usr/local/bin/gunicorn config.asgi --bind 0.0.0.0:5000 --chdir=/app -k uvicorn.workers.UvicornWorker +exec newrelic-admin run-program /usr/local/bin/gunicorn config.asgi \ + --workers "${WEB_WORKERS:-4}" \ + --bind 0.0.0.0:5000 --chdir=/app -k uvicorn.workers.UvicornWorker