2019-12-15 15:33:09 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -euo pipefail
|
2019-12-04 04:50:46 +00:00
|
|
|
cd /app
|
2019-07-12 09:10:15 +00:00
|
|
|
|
2019-07-12 14:20:59 +00:00
|
|
|
GUNICORN_TIMEOUT="${GUINCORN_TIMEOUT:-120}"
|
|
|
|
GUNICORN_WORKERS="${GUNICORN_WORKERS:-4}"
|
|
|
|
GUNICORN_LOGLEVEL="${GUNICORN_LOGLEVEL:-info}"
|
2019-07-24 07:40:11 +00:00
|
|
|
BIND_ADDRESS="${BIND_ADDRESS:-0.0.0.0:80}"
|
2019-07-12 14:20:59 +00:00
|
|
|
|
2019-12-04 04:50:46 +00:00
|
|
|
cat ./powerdnsadmin/default_config.py ./configs/docker_config.py > ./powerdnsadmin/docker_config.py
|
2019-07-12 09:10:15 +00:00
|
|
|
|
2019-07-24 07:40:11 +00:00
|
|
|
GUNICORN_ARGS="-t ${GUNICORN_TIMEOUT} --workers ${GUNICORN_WORKERS} --bind ${BIND_ADDRESS} --log-level ${GUNICORN_LOGLEVEL}"
|
2019-07-12 09:10:15 +00:00
|
|
|
if [ "$1" == gunicorn ]; then
|
2019-07-12 13:03:19 +00:00
|
|
|
flask db upgrade
|
2019-07-12 14:20:59 +00:00
|
|
|
exec "$@" $GUNICORN_ARGS
|
2019-07-12 09:10:15 +00:00
|
|
|
|
2019-07-12 14:20:59 +00:00
|
|
|
else
|
|
|
|
exec "$@"
|
|
|
|
fi
|