powerdns-admin/docker/Production/entrypoint.sh

22 lines
574 B
Bash
Raw Normal View History

2019-07-12 09:10:15 +00:00
#!/bin/bash
set -Eeuo pipefail
cd /opt/powerdns-admin
GUNICORN_TIMEOUT="${GUINCORN_TIMEOUT:-120}"
GUNICORN_WORKERS="${GUNICORN_WORKERS:-4}"
GUNICORN_LOGLEVEL="${GUNICORN_LOGLEVEL:-info}"
BIND_ADDRESS="${BIND_ADDRESS:-0.0.0.0:80}"
2019-07-12 09:10:15 +00:00
if [ ! -f ./config.py ]; then
cat ./config_template.py ./docker/Production/config_docker.py > ./config.py
fi
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
exec "$@" $GUNICORN_ARGS
2019-07-12 09:10:15 +00:00
else
exec "$@"
fi