prepare docker setup for http remote backend
This commit is contained in:
parent
33ca0443ff
commit
c2e7b6f2d2
7 changed files with 16 additions and 38 deletions
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.7
|
FROM golang:1.9
|
||||||
|
|
||||||
WORKDIR /go/src/github.com/pboehm/ddns
|
WORKDIR /go/src/github.com/pboehm/ddns
|
||||||
COPY . .
|
COPY . .
|
||||||
|
@ -6,4 +6,6 @@ COPY . .
|
||||||
RUN go-wrapper download # "go get -d -v ./..."
|
RUN go-wrapper download # "go get -d -v ./..."
|
||||||
RUN go-wrapper install # "go install -v ."
|
RUN go-wrapper install # "go install -v ."
|
||||||
|
|
||||||
CMD ["/bin/true"]
|
ENV GIN_MODE release
|
||||||
|
|
||||||
|
CMD /go/bin/ddns --domain=${DDNS_DOMAIN} --soa_fqdn=${DDNS_SOA_DOMAIN} --redis=redis:6379 web
|
||||||
|
|
|
@ -1,42 +1,27 @@
|
||||||
version: '2'
|
version: '2'
|
||||||
|
|
||||||
volumes:
|
|
||||||
ddns:
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
ddns:
|
ddns:
|
||||||
|
restart: unless-stopped
|
||||||
build:
|
build:
|
||||||
context: ..
|
context: ..
|
||||||
dockerfile: docker/ddns/Dockerfile
|
dockerfile: docker/ddns/Dockerfile
|
||||||
volumes:
|
|
||||||
- ddns:/go/bin/
|
|
||||||
|
|
||||||
ddns-web:
|
|
||||||
restart: unless-stopped
|
|
||||||
build:
|
|
||||||
context: web/
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
volumes_from:
|
|
||||||
- ddns
|
|
||||||
environment:
|
environment:
|
||||||
DDNS_DOMAIN: d.example.net
|
DDNS_DOMAIN: d.example.net
|
||||||
|
DDNS_SOA_DOMAIN: soa.example.net
|
||||||
|
|
||||||
ddns-powerdns:
|
powerdns:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
build:
|
build:
|
||||||
context: powerdns/
|
context: powerdns/
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
|
||||||
volumes_from:
|
|
||||||
- ddns
|
- ddns
|
||||||
environment:
|
environment:
|
||||||
DDNS_DOMAIN: d.example.net
|
PDNS_REMOTE_HTTP_HOST: "ddns:8080"
|
||||||
DDNS_SOA_DOMAIN: soa.example.net
|
|
||||||
DDNS_VERBOSE: --verbose
|
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
image: redis:latest
|
image: redis:4-alpine
|
|
@ -2,11 +2,11 @@ FROM buildpack-deps:jessie-scm
|
||||||
MAINTAINER Philipp Böhm <philipp@pboehm.org>
|
MAINTAINER Philipp Böhm <philipp@pboehm.org>
|
||||||
|
|
||||||
# the setup procedure according to https://repo.powerdns.com/ (Debian 8 Jessie)
|
# 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 \
|
RUN echo "deb http://repo.powerdns.com/debian jessie-auth-41 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 \
|
&& 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 - \
|
&& curl https://repo.powerdns.com/FD380FBB-pub.asc | apt-key add - \
|
||||||
&& apt-get -y update \
|
&& apt-get -y update \
|
||||||
&& apt-get install -y pdns-server pdns-backend-pipe \
|
&& apt-get install -y pdns-server pdns-backend-remote \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY pdns.conf /etc/powerdns/pdns.conf
|
COPY pdns.conf /etc/powerdns/pdns.conf
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
CONFIG_FILE=/etc/powerdns/pdns.conf
|
CONFIG_FILE=/etc/powerdns/pdns.conf
|
||||||
|
|
||||||
sed -i 's/{{DDNS_DOMAIN}}/'"${DDNS_DOMAIN}"'/g' ${CONFIG_FILE}
|
sed -i 's/{{PDNS_REMOTE_HTTP_HOST}}/'"${PDNS_REMOTE_HTTP_HOST}"'/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 "$@"
|
exec "$@"
|
|
@ -3,7 +3,6 @@ cache-ttl=0
|
||||||
loglevel=7
|
loglevel=7
|
||||||
log-dns-details=yes
|
log-dns-details=yes
|
||||||
disable-axfr=yes
|
disable-axfr=yes
|
||||||
pipe-abi-version=1
|
|
||||||
|
|
||||||
launch=pipe
|
launch=remote
|
||||||
pipe-command=/go/bin/ddns --domain={{DDNS_DOMAIN}} --soa_fqdn={{DDNS_SOA_DOMAIN}} --redis=redis:6379 {{DDNS_VERBOSE}} backend
|
remote-connection-string=http:url=http://{{PDNS_REMOTE_HTTP_HOST}}/dnsapi
|
|
@ -1,6 +0,0 @@
|
||||||
FROM buildpack-deps:jessie-scm
|
|
||||||
MAINTAINER Philipp Böhm <philipp@pboehm.org>
|
|
||||||
|
|
||||||
ENV GIN_MODE release
|
|
||||||
|
|
||||||
CMD /go/bin/ddns --domain=${DDNS_DOMAIN} --redis=redis:6379 web
|
|
|
@ -168,7 +168,7 @@ const indexTemplate string = `
|
||||||
function validate() {
|
function validate() {
|
||||||
var hostname = $('#hostname').val();
|
var hostname = $('#hostname').val();
|
||||||
|
|
||||||
$.getJSON("/available/" + hostname + "/", function( data ) {
|
$.getJSON("/available/" + hostname, function( data ) {
|
||||||
if (data.available) {
|
if (data.available) {
|
||||||
isValid();
|
isValid();
|
||||||
} else {
|
} else {
|
||||||
|
@ -188,7 +188,7 @@ const indexTemplate string = `
|
||||||
$('#register').click(function() {
|
$('#register').click(function() {
|
||||||
var hostname = $("#hostname").val();
|
var hostname = $("#hostname").val();
|
||||||
|
|
||||||
$.getJSON("/new/" + hostname + "/", function( data ) {
|
$.getJSON("/new/" + hostname, function( data ) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
|
||||||
var host = location.protocol + '//' + location.host;
|
var host = location.protocol + '//' + location.host;
|
||||||
|
|
Loading…
Reference in a new issue