forked from pan-net-security/certbot-dns-powerdns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
85 lines (85 loc) · 2.13 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
version: "3"
networks:
default:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.40.40.0/24
services:
pebble:
image: letsencrypt/pebble:v2.0.0
command: pebble -config /test/config/pebble-config.json -strict -dnsserver 10.40.40.3:53
ports:
# HTTPS ACME API
- 14000:14000
# volumes:
# - ./test/config:/test/config
environment:
- PEBBLE_WFE_NONCEREJECT=0
networks:
default:
ipv4_address: 10.40.40.2
pdns:
image: psitrax/powerdns:${POWERDNS_VERSION:-v4.2.0}
command:
- "--api"
- "--api-key=secret"
- "--webserver"
- "--webserver-address=0.0.0.0"
- "--webserver-allow-from=0.0.0.0/0"
- "--loglevel=10"
environment:
MYSQL_USER: root
MYSQL_PASS: secret
networks:
default:
ipv4_address: 10.40.40.3
depends_on:
- mysql
ports:
- "8081:8081"
- "8053:53"
- "8053:53/udp"
mysql:
image: mariadb:10.4.7-bionic
networks:
default:
ipv4_address: 10.40.40.4
environment:
MYSQL_ROOT_PASSWORD: secret
setup:
image: alpine:3.9
networks:
default:
ipv4_address: 10.40.40.200
depends_on:
- pdns
- pebble
command:
- sh
- -c
- |
apk add --no-cache curl &&
# check if pdns is ready
while true; do
echo "Checking if PDNS is up and responsing ... "
if curl -f http://pdns:8081/api -H "X-API-Key: secret"; then
break
fi
sleep 1
done
# check if pebble is ready
while true; do
echo "Checking if Pebble is up and responding ... "
if curl -k -f https://pebble:14000/dir; then
break
fi
sleep 1
done
curl -X POST http://pdns:8081/api/v1/servers/localhost/zones \
-d '{"name": "example.org.", "kind": "Native", "soa_edit_api": "", "nameservers": ["ns1.example.org."]}' \
-H "X-API-Key: secret"
curl -s -X POST http://pdns:8081/api/v1/servers/localhost/zones \
-d '{"name": "in-addr.arpa.", "kind": "Native", "nameservers": ["ns1.example.org."]}' \
-H "X-API-Key: secret"