Skip to content

Instantly share code, notes, and snippets.

@megabert
Last active February 18, 2019 16:17
Show Gist options
  • Save megabert/9bbd6d41be5465f2d07953bb627ba8cb to your computer and use it in GitHub Desktop.
Save megabert/9bbd6d41be5465f2d07953bb627ba8cb to your computer and use it in GitHub Desktop.
PDNSManager Dockerfile + docker-compose.yml

A Dockerfile for pdnsmanager and a docker-compose file includes an additional mysql-container.

Works not as intended, because I would like to have pdnsmanager separate from the powerdns database and do not like pdnsmanager to set up the database. This should be done by powerdns itself.

version: '2.1'
services:
pdnsmaster:
container_name: pdnsmanager
image: pdnsmanager
build: "."
restart: always
ports:
- "80:80/tcp"
networks:
- default
pdnsmanager-mysql:
image: mysql/mysql-server:5.7
hostname: ${PDA_DB_HOST}
container_name: pdnsmanager-mysql
mem_limit: 256M
memswap_limit: 256M
volumes:
- powerdns-admin-mysql-data:/var/lib/mysql
networks:
- default
environment:
- MYSQL_DATABASE=${PDA_DB_NAME}
- MYSQL_USER=${PDA_DB_USER}
- MYSQL_PASSWORD=${PDA_DB_PASSWORD}
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 10s
retries: 5
networks:
default:
volumes:
powerdns-admin-mysql-data:
# Dockerfile
FROM alpine:latest
ENV PDNSMANAGER_VERSION 2.0.1
ENV PDNS_ARCHIVE=pdnsmanager-${PDNSMANAGER_VERSION}.tar.gz
RUN apk add apache2 apache2-ctl php7-apache2 php7 php7-pdo php7-pdo_mysql php7-json php7-pecl-apcu
COPY files/conf/apache-vhost.conf /etc/apache2/conf.d/pdnsmanager.conf
COPY files/archive/$PDNS_ARCHIVE /tmp
RUN mkdir /var/www/html
RUN tar -C /var/www/html --strip-components=1 -xzf /tmp/$PDNS_ARCHIVE pdnsmanager-${PDNSMANAGER_VERSION}/backend pdnsmanager-${PDNSMANAGER_VERSION}/frontend
RUN chown apache:apache -R /var/www/html
RUN rm -f /tmp/$PDNS_ARCHIVE
RUN sed -i '/LoadModule rewrite_module/s/^#//g' /etc/apache2/httpd.conf
WORKDIR /etc/apache2
CMD { apachectl -d . -f httpd.conf -e info -DFOREGROUND ; sleep 60 ; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment