From 5466a2d64d6cea7326a6382534d040bab8055c15 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Thu, 21 Nov 2019 23:16:39 +0000 Subject: Rename run.sh to entrypoint.sh --- utils/entrypoint.sh | 25 +++++++++++++++++++++++++ utils/run.sh | 21 --------------------- 2 files changed, 25 insertions(+), 21 deletions(-) create mode 100755 utils/entrypoint.sh delete mode 100755 utils/run.sh (limited to 'utils') diff --git a/utils/entrypoint.sh b/utils/entrypoint.sh new file mode 100755 index 0000000..0296d9d --- /dev/null +++ b/utils/entrypoint.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# +# The entrypoint for the docker containers +# + +# Debug +# FLASK_APP=app/__init__.py FLASK_CONFIG=../config.cfg FLASK_DEBUG=1 python3 -m flask run -h 0.0.0.0 -p 5123 + +if [ -z "$FLASK_DEBUG" ]; then + echo "FLASK_DEBUG is required in config.env" + exit 1 +fi + +ENV="-e FLASK_APP=app/__init__.py -e FLASK_CONFIG=../config.cfg -e FLASK_DEBUG=$FLASK_DEBUG" + +if [ "$FLASK_DEBUG" -eq "1" ]; then + EXTRA="--reload" +fi + +echo "Running gunicorn with:" +echo " - env: $ENV" +echo " - extra: $EXTRA" + +gunicorn -w 4 -b :5123 $ENV $EXTRA app:app diff --git a/utils/run.sh b/utils/run.sh deleted file mode 100755 index dee2a54..0000000 --- a/utils/run.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# Debug -# FLASK_APP=app/__init__.py FLASK_CONFIG=../config.cfg FLASK_DEBUG=1 python3 -m flask run -h 0.0.0.0 -p 5123 - -if [ -z "$FLASK_DEBUG" ]; then - echo "FLASK_DEBUG is required in config.env" - exit 1 -fi - -ENV="-e FLASK_APP=app/__init__.py -e FLASK_CONFIG=../config.cfg -e FLASK_DEBUG=$FLASK_DEBUG" - -if [ "$FLASK_DEBUG" -eq "1" ]; then - EXTRA="--reload" -fi - -echo "Running gunicorn with:" -echo " - env: $ENV" -echo " - extra: $EXTRA" - -gunicorn -w 4 -b :5123 $ENV $EXTRA app:app -- cgit v1.2.3