]> git.lizzy.rs Git - cheatdb.git/blob - utils/entrypoint.sh
Rename run.sh to entrypoint.sh
[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 ENV="-e FLASK_APP=app/__init__.py -e FLASK_CONFIG=../config.cfg -e FLASK_DEBUG=$FLASK_DEBUG"
16
17 if [ "$FLASK_DEBUG" -eq "1" ]; then
18         EXTRA="--reload"
19 fi
20
21 echo "Running gunicorn with:"
22 echo " - env: $ENV"
23 echo " - extra: $EXTRA"
24
25 gunicorn -w 4 -b :5123 $ENV $EXTRA app:app