From a407f3228c7111329961d437c13ca2377f7229e2 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Mon, 3 Oct 2022 20:37:56 +0000 Subject: [PATCH] Use env var for PROD_PORT --- start | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/start b/start index d85621d..30effd8 100755 --- a/start +++ b/start @@ -2,6 +2,8 @@ SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" +source ./env + if ! test -f "$SCRIPT_DIR/.undercover_init_successful"; then if ! "$SCRIPT_DIR/init"; then exit 1 @@ -13,9 +15,15 @@ if ! pip3 -V | grep -E "$SCRIPT_DIR/\.?venv"; then source "$SCRIPT_DIR/.venv/bin/activate" fi +PROD_PORT=8080 + +if [[ "$UNDERCOVER_PROD_PORT" != "" ]]; then + PROD_PORT="$UNDERCOVER_PROD_PORT" +fi + if [[ "$1" == "prod" ]]; then echo "Starting gunicorn production server..." - gunicorn -b localhost:8080 "app:create_app()" + gunicorn -b localhost:$PROD_PORT "app:create_app()" else echo "Starting local dev server..." export FLASK_APP=app