From 6ab6abacb0ac6e6290054f91f9dfcdd2e994df2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zahradn=C3=ADk?= Date: Fri, 6 Sep 2024 19:21:33 +0200 Subject: [PATCH] add common gunicorn start script, and worker count --- Dockerfile | 2 ++ base/gunicorn.sh | 3 +++ 2 files changed, 5 insertions(+) create mode 100755 base/gunicorn.sh diff --git a/Dockerfile b/Dockerfile index 9e3c5c8..6274c27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,5 +24,7 @@ RUN chown appuser:appuser /app ENV POETRY_VIRTUALENVS_CREATE=0 RUN pip install --upgrade poetry +ENV WEB_CONCURRENCY=4 + COPY base /base CMD ["/base/start.sh"] diff --git a/base/gunicorn.sh b/base/gunicorn.sh new file mode 100755 index 0000000..8826ec6 --- /dev/null +++ b/base/gunicorn.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +exec gunicorn --bind 127.0.0.1:8001 --access-logfile - --max-requests 2000 --max-requests-jitter 100 $1