From 9d60ffdbf8a11bd56776f9cd0b0b708bba2eaa37 Mon Sep 17 00:00:00 2001 From: Ivo Branco Date: Thu, 24 Oct 2024 14:55:16 +0100 Subject: [PATCH] feat: add `UWSGI_WORKERS` environment variable Allow to change the uwsgi workers/processes. --- Dockerfile | 3 +++ uwsgi.ini | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fc4650e..c6ba00a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,6 +63,9 @@ RUN pip install \ COPY requirements.txt . RUN python -m pip install -r requirements.txt +# Default amount of uWSGI processes +ENV UWSGI_WORKERS=2 + COPY app.py uwsgi.ini default-config.yml ./ COPY static static COPY nau nau diff --git a/uwsgi.ini b/uwsgi.ini index 9b5e9af..8bf56a5 100644 --- a/uwsgi.ini +++ b/uwsgi.ini @@ -4,7 +4,10 @@ http-socket = :5000 endif = master = true -processes = 5 +workers = 1 +if-env = UWSGI_WORKERS +workers = %(_) +endif = strict = true enable-threads = true