Sistema de Informações Gerenciais do Interlegis
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
824 B

#!/bin/bash
# This script expects the following ENV variables:
# $SOCKS : Path to the dir that holds unix socket file
# - Defined as /srv/interlegis/socks in Dockerfile
# $HOME : Path to app home work dir.
# - Defined as /srv/interlegis/sigi in Dockerfile
NAME="sigi"
SOCKFILE=$SOCKS/sigi.sock
NUM_WORKERS=3 # = 2 * CPUs + 1
DJANGO_SETTINGS_MODULE=sigi.settings
DJANGO_WSGI_MODULE=sigi.wsgi
echo "Preparing environment and data..."
${HOME}/bin/prepare_environment.sh
echo "... done!"
echo "Starting $NAME as `whoami`..."
cd ${HOME}
export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
export PYTHONPATH=${HOME}:$PYTHONPATH
exec gunicorn ${DJANGO_WSGI_MODULE}:application \
--name $NAME \
--workers $NUM_WORKERS \
--log-level=debug \
--timeout=180 \
--graceful-timeout=180 \
--bind=unix:$SOCKFILE