First partial working docker setup
add initial version of docker setup add configuration via environment variables remove override file support docker-compose.override.yml add up2date pdns container
This commit is contained in:
parent
6af394aa2f
commit
e82621e153
|
@ -1,5 +1,4 @@
|
||||||
*.swp
|
*.swp
|
||||||
pdns.conf
|
/docker/docker-compose.override.yml
|
||||||
pdns_backend.py
|
/ddns
|
||||||
ddns
|
|
||||||
dump.rdb
|
dump.rdb
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
FROM golang:1.7-onbuild
|
||||||
|
|
||||||
|
CMD ["/bin/true"]
|
|
@ -0,0 +1,43 @@
|
||||||
|
version: '2'
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
ddns:
|
||||||
|
|
||||||
|
services:
|
||||||
|
ddns:
|
||||||
|
restart: unless-stopped
|
||||||
|
build:
|
||||||
|
context: ..
|
||||||
|
dockerfile: docker/ddns/Dockerfile
|
||||||
|
volumes:
|
||||||
|
- ddns:/go/bin/
|
||||||
|
|
||||||
|
ddns-web:
|
||||||
|
restart: unless-stopped
|
||||||
|
build:
|
||||||
|
context: web/
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
volumes_from:
|
||||||
|
- ddns
|
||||||
|
environment:
|
||||||
|
DDNS_DOMAIN: d.example.net
|
||||||
|
|
||||||
|
ddns-powerdns:
|
||||||
|
restart: unless-stopped
|
||||||
|
build:
|
||||||
|
context: powerdns/
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
volumes_from:
|
||||||
|
- ddns
|
||||||
|
environment:
|
||||||
|
DDNS_DOMAIN: d.example.net
|
||||||
|
DDNS_SOA_DOMAIN: soa.example.net
|
||||||
|
DDNS_VERBOSE: --verbose
|
||||||
|
|
||||||
|
redis:
|
||||||
|
restart: unless-stopped
|
||||||
|
image: redis:latest
|
|
@ -0,0 +1,20 @@
|
||||||
|
FROM buildpack-deps:jessie-scm
|
||||||
|
MAINTAINER Philipp Böhm <philipp@pboehm.org>
|
||||||
|
|
||||||
|
# the setup procedure according to https://repo.powerdns.com/ (Debian 8 Jessie)
|
||||||
|
RUN echo "deb http://repo.powerdns.com/debian jessie-auth-40 main" > /etc/apt/sources.list.d/pdns.list \
|
||||||
|
&& echo "Package: pdns-*\nPin: origin repo.powerdns.com\nPin-Priority: 600\n" >> /etc/apt/preferences.d/pdns \
|
||||||
|
&& curl https://repo.powerdns.com/FD380FBB-pub.asc | apt-key add - \
|
||||||
|
&& apt-get -y update \
|
||||||
|
&& apt-get install -y pdns-server pdns-backend-pipe \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY pdns.conf /etc/powerdns/pdns.conf
|
||||||
|
|
||||||
|
COPY entrypoint.sh /
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
||||||
|
EXPOSE 53
|
||||||
|
|
||||||
|
CMD ["pdns_server", "--daemon=no"]
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
CONFIG_FILE=/etc/powerdns/pdns.conf
|
||||||
|
|
||||||
|
sed -i 's/{{DDNS_DOMAIN}}/'"${DDNS_DOMAIN}"'/g' ${CONFIG_FILE}
|
||||||
|
sed -i 's/{{DDNS_SOA_DOMAIN}}/'"${DDNS_SOA_DOMAIN}"'/g' ${CONFIG_FILE}
|
||||||
|
sed -i 's/{{DDNS_VERBOSE}}/'"${DDNS_VERBOSE}"'/g' ${CONFIG_FILE}
|
||||||
|
|
||||||
|
exec "$@"
|
|
@ -0,0 +1,8 @@
|
||||||
|
disable-tcp=yes
|
||||||
|
cache-ttl=0
|
||||||
|
loglevel=7
|
||||||
|
log-dns-details=yes
|
||||||
|
disable-axfr=yes
|
||||||
|
|
||||||
|
launch=pipe
|
||||||
|
pipe-command=/go/bin/app --domain={{DDNS_DOMAIN}} --soa_fqdn={{DDNS_SOA_DOMAIN}} --redis=redis:6379 {{DDNS_VERBOSE}} backend
|
|
@ -0,0 +1,6 @@
|
||||||
|
FROM buildpack-deps:jessie-scm
|
||||||
|
MAINTAINER Philipp Böhm <philipp@pboehm.org>
|
||||||
|
|
||||||
|
ENV GIN_MODE release
|
||||||
|
|
||||||
|
CMD /go/bin/app --domain=${DDNS_DOMAIN} --redis=redis:6379 web
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"../config"
|
"../config"
|
||||||
"../hosts"
|
"../hosts"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/gin-gonic/gin"
|
"gopkg.in/gin-gonic/gin.v1"
|
||||||
"html/template"
|
"html/template"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
|
|
Loading…
Reference in New Issue