New docker image based on Alpine Linux

This commit is contained in:
Jeroen Boonstra 2018-03-28 11:31:04 +02:00
parent 71faaf4d17
commit be4afd5ca6
2 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,42 @@
# PowerDNS-Admin
# Original from:
# https://github.com/ngoduykhanh/PowerDNS-Admin
#
# Initial image by winggundamth(/powerdns-mysql:trusty)
#
#
FROM alpine
MAINTAINER Jeroen Boonstra <jeroen [at] provider.nl>
ENV APP_USER=web APP_NAME=powerdns-admin
ENV APP_PATH=/home/$APP_USER/$APP_NAME
RUN apk add --update \
sudo \
python \
libxml2 \
xmlsec \
git \
python-dev \
py-pip \
build-base \
libxml2-dev \
xmlsec-dev \
libffi-dev \
openldap-dev \
&& adduser -S web
RUN sudo -u $APP_USER -H git clone --depth=1 \
https://github.com/thomasDOTde/PowerDNS-Admin $APP_PATH
RUN pip install -r $APP_PATH/requirements.txt
COPY docker-entrypoint.sh /docker-entrypoint.sh
USER $APP_USER
WORKDIR $APP_PATH
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["python", "run.py"]
EXPOSE 9393
VOLUME ["/var/log"]

View File

@ -0,0 +1,12 @@
#!/bin/sh
set -e
if [ "$WAITFOR_DB" -a ! -f "$APP_PATH/config.py" ]; then
cp "$APP_PATH/config_template_docker.py" "$APP_PATH/config.py"
fi
cd $APP_PATH && python create_db.py
# Start PowerDNS Admin
exec "$@"