Use env var for PROD_PORT
This commit is contained in:
parent
c26758f468
commit
a407f3228c
10
start
10
start
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
|
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
|
||||||
|
|
||||||
|
source ./env
|
||||||
|
|
||||||
if ! test -f "$SCRIPT_DIR/.undercover_init_successful"; then
|
if ! test -f "$SCRIPT_DIR/.undercover_init_successful"; then
|
||||||
if ! "$SCRIPT_DIR/init"; then
|
if ! "$SCRIPT_DIR/init"; then
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -13,9 +15,15 @@ if ! pip3 -V | grep -E "$SCRIPT_DIR/\.?venv"; then
|
||||||
source "$SCRIPT_DIR/.venv/bin/activate"
|
source "$SCRIPT_DIR/.venv/bin/activate"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
PROD_PORT=8080
|
||||||
|
|
||||||
|
if [[ "$UNDERCOVER_PROD_PORT" != "" ]]; then
|
||||||
|
PROD_PORT="$UNDERCOVER_PROD_PORT"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$1" == "prod" ]]; then
|
if [[ "$1" == "prod" ]]; then
|
||||||
echo "Starting gunicorn production server..."
|
echo "Starting gunicorn production server..."
|
||||||
gunicorn -b localhost:8080 "app:create_app()"
|
gunicorn -b localhost:$PROD_PORT "app:create_app()"
|
||||||
else
|
else
|
||||||
echo "Starting local dev server..."
|
echo "Starting local dev server..."
|
||||||
export FLASK_APP=app
|
export FLASK_APP=app
|
||||||
|
|
Loading…
Reference in New Issue