From 8b4022f5bbdd6fbb74d76c571d4b45a041c4a8dc Mon Sep 17 00:00:00 2001 From: Michael Hiiva Date: Tue, 12 Oct 2021 13:33:44 -0700 Subject: [PATCH 1/2] Set Processes for Uwsgi. --- scripts/entrypoint.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index c4ce42f2..39228d4c 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -41,13 +41,21 @@ function start_server() { if [ $r_flag == 0 ]; then - uwsgi --http-socket 0.0.0.0:3031 --module agagd.wsgi \ - --static-map /static=/tmp/static/ --static-map /media=/srv/media \ - --enable-threads --python-autoreload 1 + uwsgi --http-socket 0.0.0.0:3031 \ + --module agagd.wsgi \ + --static-map /static=/tmp/static/ \ + --static-map /media=/srv/media \ + --enable-threads \ + --python-autoreload 1 \ + --processes 2 elif [ $r_flag == 1 ]; then - uwsgi --http-socket 0.0.0.0:3031 --module agagd.wsgi \ - --static-map /static=/tmp/static/ --static-map /media=/srv/media + uwsgi --http-socket 0.0.0.0:3031 \ + --module agagd.wsgi \ + --static-map /static=/tmp/static/ \ + --static-map /media=/srv/media + --enable-threads \ + --processes 2 fi } From b607ecb3d41fa8f856ddaf1534b5304752af865e Mon Sep 17 00:00:00 2001 From: Michael Hiiva Date: Tue, 12 Oct 2021 13:36:39 -0700 Subject: [PATCH 2/2] Add UWSGI to requirements text. --- Dockerfile | 2 +- requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fe9afd20..6c93f790 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN apt-get update && apt-get install -y \ RUN pip install --no-cache-dir -U pip COPY requirements.txt /build/ -RUN pip install --user --no-cache-dir -r requirements.txt && pip install --user --no-cache-dir uwsgi +RUN pip install --user --no-cache-dir -r requirements.txt ### Final image FROM python:3.9-slim-buster diff --git a/requirements.txt b/requirements.txt index 8a173eac..06714cde 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,3 +6,4 @@ django-extensions==3.1.3 jinja2==2.11.3 PyMySQL==1.0.2 yolk==0.4.3 +uwsgi==2.0.20