Use sqlite by default in docker

This allows for easy setup with no extra configuration.
Also update docs to reflect the new and easy way to run PowerDNS-Admin.

Signed-off-by: Felix Kaechele <felix@kaechele.ca>
This commit is contained in:
Felix Kaechele
2020-04-20 18:23:57 -04:00
parent 452c4a02d8
commit 06266846ec
4 changed files with 33 additions and 13 deletions

View File

@ -76,7 +76,9 @@ ENV FLASK_APP=/app/powerdnsadmin/__init__.py
RUN apk add --no-cache mariadb-connector-c postgresql-client py3-gunicorn py3-psycopg2 xmlsec tzdata && \
addgroup -S pda && \
adduser -S -D -G pda pda
adduser -S -D -G pda pda && \
mkdir /data && \
chown pda:pda /data
COPY --from=builder /usr/bin/flask /usr/bin/
COPY --from=builder /usr/lib/python3.8/site-packages /usr/lib/python3.8/site-packages/

View File

@ -11,7 +11,9 @@ cat ./powerdnsadmin/default_config.py ./configs/docker_config.py > ./powerdnsadm
GUNICORN_ARGS="-t ${GUNICORN_TIMEOUT} --workers ${GUNICORN_WORKERS} --bind ${BIND_ADDRESS} --log-level ${GUNICORN_LOGLEVEL}"
if [ "$1" == gunicorn ]; then
flask db upgrade
# run as user pda so that if a SQLite database is generated it is writeable
# by that user
su pda -s /bin/sh -c "flask db upgrade"
exec "$@" $GUNICORN_ARGS
else