]> git.lizzy.rs Git - cheatdb.git/blob - utils/entrypoint.sh
Fix typo
[cheatdb.git] / utils / entrypoint.sh
1 #!/bin/bash
2
3 #
4 # The entrypoint for the docker containers
5 #
6
7 # Debug
8 # FLASK_APP=app/__init__.py FLASK_CONFIG=../config.cfg FLASK_DEBUG=1 python3 -m flask run -h 0.0.0.0 -p 5123
9
10 if [ -z "$FLASK_DEBUG" ]; then
11         echo "FLASK_DEBUG is required in config.env"
12         exit 1
13 fi
14
15 if [ "$FLASK_DEBUG" -eq "1" ]; then
16         FLASK_APP=app/__init__.py FLASK_CONFIG=../config.cfg FLASK_RUN_PORT=5123 flask run --host=0.0.0.0
17 else
18         ENV="-e FLASK_APP=app/__init__.py -e FLASK_CONFIG=../config.cfg -e FLASK_DEBUG=$FLASK_DEBUG"
19         gunicorn -w 4 -b :5123 $ENV app:app
20 fi