diff --git a/infra/concrexit/Dockerfile b/infra/concrexit/Dockerfile index 4e2d1a7f5..00fa903b6 100644 --- a/infra/concrexit/Dockerfile +++ b/infra/concrexit/Dockerfile @@ -60,6 +60,7 @@ RUN apt-get update && \ COPY infra/concrexit/server-entrypoint.sh /app/server-entrypoint.sh COPY infra/concrexit/worker-entrypoint.sh /app/worker-entrypoint.sh +COPY infra/concrexit/gunicorn.conf.py /app/gunicorn.conf.py # CMD can be set to /app/worker-entrypoint.sh for a celery worker container. CMD [ "/app/server-entrypoint.sh" ] diff --git a/infra/concrexit/gunicorn.conf.py b/infra/concrexit/gunicorn.conf.py new file mode 100644 index 000000000..66aa324ef --- /dev/null +++ b/infra/concrexit/gunicorn.conf.py @@ -0,0 +1,9 @@ +import multiprocessing + +bind = "0.0.0.0:8000" +loglevel = "info" +capture_output = True +timeout = 240 + +workers = multiprocessing.cpu_count() * 2 + 1 +threads = 2 diff --git a/infra/concrexit/server-entrypoint.sh b/infra/concrexit/server-entrypoint.sh index 3c547d0b5..723143aee 100755 --- a/infra/concrexit/server-entrypoint.sh +++ b/infra/concrexit/server-entrypoint.sh @@ -9,10 +9,5 @@ MANAGE_PY=1 runuser -u appuser -- ./manage.py createcachetable exec runuser -u appuser -- /venv/bin/gunicorn \ - --bind 0.0.0.0:8000 \ - --log-level info \ - --worker-class gthread \ - --workers 4 \ - --threads 4 \ - --timeout 240 \ - --capture-output thaliawebsite.wsgi:application \ + --config=/app/gunicorn.conf.py \ + thaliawebsite.wsgi:application