From 838978c9ffa6b7c73dc0bfe4e3ee72371a058fa9 Mon Sep 17 00:00:00 2001 From: Benjamin Copeland Date: Tue, 8 May 2018 12:03:12 +0100 Subject: LLP: Update docker_run.sh Move the collectstatic and migration out of the block so we can use it in both DEBUG and Production mode Change-Id: Id725dee008cc19fe27f92dd6f1031031700000ec --- ci-amd64-llp-alpine/docker_run.sh | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'ci-amd64-llp-alpine/docker_run.sh') diff --git a/ci-amd64-llp-alpine/docker_run.sh b/ci-amd64-llp-alpine/docker_run.sh index 52c27ae1..8e35b7a4 100755 --- a/ci-amd64-llp-alpine/docker_run.sh +++ b/ci-amd64-llp-alpine/docker_run.sh @@ -12,15 +12,14 @@ if [ -z "$DJANGO_DEBUG" ] ; then echo "$html_header" >> /srv/header_override.html fi - if [ ! -z "$DJANGO_MIGRATE" ]; then - python $APPDIR/manage.py migrate --noinput - fi - if [ ! -z "$DJANGO_COLLECTSTATIC" ]; then - python $APPDIR/manage.py collectstatic --noinput - fi - exec /usr/bin/gunicorn -w4 -b 0.0.0.0:$PORT $LLP_APP fi -python $APPDIR/manage.py migrate --noinput --settings=settings -exec python $APPDIR/manage.py runserver 0.0.0.0:8080 --settings=settings +if [ ! -z "$DJANGO_MIGRATE" ]; then + python $APPDIR/manage.py migrate --noinput --settings=$DJANGO_SETTINGS_MODULE +fi +if [ ! -z "$DJANGO_COLLECTSTATIC" ]; then + python $APPDIR/manage.py collectstatic --noinput --settings=$DJANGO_SETTINGS_MODULE +fi + +exec python $APPDIR/manage.py runserver 0.0.0.0:8080 --settings=$DJANGO_SETTINGS_MODULE -- cgit v1.2.3