From f78ed7592dd7567441928d8af940cd0c9e4704a4 Mon Sep 17 00:00:00 2001 From: Ruben van Staveren Date: Mon, 25 Dec 2023 14:15:39 +0100 Subject: [PATCH] Add startup script and socket directory for gunicorn --- run/.gitkeep | 0 start.sh | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 run/.gitkeep create mode 100755 start.sh diff --git a/run/.gitkeep b/run/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..4d2722f --- /dev/null +++ b/start.sh @@ -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=-