Add startup script and socket directory for gunicorn

This commit is contained in:
Ruben van Staveren 2023-12-25 14:15:39 +01:00
parent 0b4322d671
commit f78ed7592d
Signed by: ruben
GPG Key ID: 886F6BECD477A93F
2 changed files with 24 additions and 0 deletions

0
run/.gitkeep Normal file
View File

24
start.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
NAME=ismijnipverweg
DIR=/opt/apps/ismijnipverweg/app
USER=www
GROUP=nobody
WORKERS=3
WORKER_CLASS=uvicorn.workers.UvicornWorker
#VENV=$DIR/.venv/bin/activate
BIND=unix:$DIR/../run/gunicorn.sock
LOG_LEVEL=debug
cd $DIR
# source $VENV
exec gunicorn main:app \
--name $NAME \
--workers $WORKERS \
--worker-class $WORKER_CLASS \
--user=$USER \
--group=$GROUP \
--bind=$BIND \
--log-level=$LOG_LEVEL \
--log-file=-