From ea7ddce7b3409d9470307e5fb61f7972286b29ca Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Sat, 11 Apr 2020 14:37:15 -0600 Subject: [PATCH] Updated dockerfile and run script to work with heroku deployment --- Dockerfile | 2 -- app/routes.py | 2 +- run.sh | 11 +++++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 269cad3..2007e76 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,4 @@ COPY . . RUN pip install --no-cache-dir -r requirements.txt -EXPOSE 5000 - CMD ["./run.sh"] diff --git a/app/routes.py b/app/routes.py index 6f225e6..adedd90 100644 --- a/app/routes.py +++ b/app/routes.py @@ -115,4 +115,4 @@ def window(): if __name__ == '__main__': - app.run(debug=True, host='0.0.0.0') + app.run(debug=True) diff --git a/run.sh b/run.sh index 1fa5273..f6e1ac4 100755 --- a/run.sh +++ b/run.sh @@ -1,6 +1,11 @@ #!/bin/bash -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +SCRIPT=`realpath $0` +SCRIPT_DIR=`dirname $SCRIPT` + +if [[ -z "${PORT}" ]]; then + PORT=5000 +fi # Create config json if it doesn't exist if [[ ! -f $SCRIPT_DIR/app/static/config.json ]]; then @@ -9,6 +14,4 @@ fi pkill flask -# TODO: Set up the following for running over https -#--cert=./app/cert.pem --key=./app/key.pem -flask run --host="0.0.0.0" +flask run --host="0.0.0.0" --port=$PORT