From 12a3d6995e25201e5035ec9e95659883f66422b0 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 10 Apr 2017 14:18:22 -0300 Subject: [PATCH] =?UTF-8?q?Modifica=20scripts=20para=20voltar=20diret?= =?UTF-8?q?=C3=B3rio=20padr=C3=A3o=20do=20gunicorn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 2 +- gunicorn_start.sh | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ce5c283fb..74d345791 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,7 +21,7 @@ sapldb: - "5532:5432" web: build: . - command: /bin/sh -c "/bin/sh busy-wait.sh && python3 manage.py bower install && python3 manage.py migrate && /bin/sh gunicorn_start.sh" + command: /bin/sh -c "/bin/sh busy-wait.sh && python3 manage.py bower install && python3 manage.py migrate && /bin/sh gunicorn_start.sh /sapl" volumes: - .:/sapl links: diff --git a/gunicorn_start.sh b/gunicorn_start.sh index aebd45c83..ebbae1725 100755 --- a/gunicorn_start.sh +++ b/gunicorn_start.sh @@ -2,9 +2,18 @@ # As seen in http://tutos.readthedocs.org/en/latest/source/ndg.html +SAPL_DIR=/var/interlegis/sapl + +# Seta um novo diretório foi passado como raiz para o SAPL +# caso esse tenha sido passado como parâmetro +if [ "$1" ] +then + SAPL_DIR="$1" +fi + NAME="SAPL" # Name of the application (*) -DJANGODIR=/sapl/ # Django project directory (*) -SOCKFILE=/sapl/run/gunicorn.sock # we will communicate using this unix socket (*) +DJANGODIR=$SAPL_DIR # Django project directory (*) +SOCKFILE=$SAPL_DIR/gunicorn.sock # we will communicate using this unix socket (*) USER=`whoami` # the user to run as (*) GROUP=`whoami` # the group to run as (*) NUM_WORKERS=3 # how many worker processes should Gunicorn spawn (*)