Skip to content

Commit

Permalink
Move gunicorn config into file
Browse files Browse the repository at this point in the history
  • Loading branch information
DeD1rk committed Nov 8, 2023
1 parent 72092c3 commit 107a28a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions infra/concrexit/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down
9 changes: 9 additions & 0 deletions infra/concrexit/gunicorn.conf.py
Original file line number Diff line number Diff line change
@@ -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
9 changes: 2 additions & 7 deletions infra/concrexit/server-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 107a28a

Please sign in to comment.