diff --git a/main.py b/main.py index 9393ed5..5ca1dd1 100644 --- a/main.py +++ b/main.py @@ -21,7 +21,7 @@ app = Flask(__name__) # local DB conn string if os.environ['FLASK_ENV'] == "production": DB_URL = 'postgresql+psycopg2://ddp:blahdeblah@bookdb:5432/library' -elif os.environ['FLASK_ENV'] == "development": +elif os.environ['FLASK_ENV'] == "container": DB_URL = 'postgresql+psycopg2://ddp:blahdeblah@bookdb_dev:5432/library' else: DB_URL = 'postgresql+psycopg2://ddp:blahdeblah@127.0.0.1:55432/library' diff --git a/wrapper.sh b/wrapper.sh index 795aa9d..bf00361 100755 --- a/wrapper.sh +++ b/wrapper.sh @@ -4,6 +4,6 @@ if [ "$FLASK_ENV" == "production" ]; then gunicorn --bind=0.0.0.0:443 --workers=2 --threads=2 --certfile /etc/letsencrypt/live/book.depaoli.id.au/fullchain.pem --keyfile /etc/letsencrypt/live/book.depaoli.id.au/privkey.pem main:app --env FLASK_ENV="production" --error-logfile gunicorn.error.log --access-logfile gunicorn.log --capture-output --enable-stdio-inheritance else cd /pybook_mapped_volume - gunicorn --bind=0.0.0.0:5000 --workers=1 --threads=1 main:app --env FLASK_ENV="development" --error-logfile gunicorn.error.log --access-logfile gunicorn.log --capture-output --enable-stdio-inheritance --reload + gunicorn --bind=0.0.0.0:5000 --workers=1 --threads=1 main:app --env FLASK_ENV="$FLASK_ENV" --error-logfile gunicorn.error.log --access-logfile gunicorn.log --capture-output --enable-stdio-inheritance --reload fi