diff --git a/podman/deploy.sh b/podman/deploy.sh index 8cfa8c6..74bcca1 100755 --- a/podman/deploy.sh +++ b/podman/deploy.sh @@ -20,6 +20,16 @@ if [ -z "$VERSION" ]; then VERSION=latest fi +if [ -z "$WORKERS" ]; then + echo "WORKERS is not set in the config file, using 4" + WORKERS=4 +fi + +if [ -z "$THREADS" ]; then + echo "THREADS is not set in the config file, using 4" + THREADS=4 +fi + podman pod stop TT-$TT_ENV podman pod rm -f TT-$TT_ENV podman volume rm -f TT-$TT_ENV-static @@ -28,6 +38,8 @@ podman pod create -p $PORT:80 --name TT-$TT_ENV podman volume create TT-$TT_ENV-static podman run --detach --pod TT-$TT_ENV --name=TT-$TT_ENV-django \ + --env WORKERS=${WORKERS} \ + --env THREADS=${THREADS} \ -v $TT_ENV_PATH/99-local.py:/secrets/settings/99-local.py:Z \ -v $TT_ENV_PATH/private.key:/opt/userportal/private.key:Z \ -v $TT_ENV_PATH/public.cert:/opt/userportal/public.cert:Z \ diff --git a/run-django-production.sh b/run-django-production.sh index ae0d5f0..5ad380a 100755 --- a/run-django-production.sh +++ b/run-django-production.sh @@ -7,4 +7,4 @@ set -o nounset cp /secrets/settings/99-local.py /opt/userportal/userportal/settings/99-local.py mkdir -p /var/www/api/static cp -r /opt/userportal/collected-static/* /var/www/api/static/ -/opt/userportal-env/bin/gunicorn --bind :8000 --workers 1 --timeout 90 userportal.wsgi +/opt/userportal-env/bin/gunicorn --bind :8000 --workers $WORKERS --threads $THREADS --timeout 90 userportal.wsgi