-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
135 lines (135 loc) · 3.21 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
version: "3"
networks:
default:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.151.40.0/24
services:
pebble:
image: letsencrypt/pebble:v2.0.0
command: pebble -config /test/config/pebble-config.json -strict -dnsserver 10.151.40.100:53
ports:
# HTTPS ACME API
- 14000:14000
# volumes:
# - ./test/config:/test/config
environment:
- PEBBLE_WFE_NONCEREJECT=0
networks:
default:
ipv4_address: 10.151.40.2
dns:
- 10.151.40.100
recursor:
image: pschiffe/pdns-recursor:alpine
environment:
PDNS_forward_zones: "auth.example.org=10.151.40.10, acme.com=10.151.40.3"
PDNS_loglevel: 9
networks:
default:
ipv4_address: 10.151.40.100
# ports:
# - "8053:53"
# - "8053:53/udp"
acmedns:
image: joohoi/acme-dns:latest
networks:
default:
ipv4_address: 10.151.40.10
dns:
- 10.151.40.100
depends_on:
- recursor
# ports:
# - "443:443"
# - "53:53"
# - "53:53/udp"
# - "80:80"
volumes:
- ./test/acmedns-server:/etc/acme-dns:ro
- ./test/acmedns-server/data:/var/lib/acme-dns
pdns:
image: psitrax/powerdns: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.151.40.3
depends_on:
- mysql
- recursor
# ports:
# - "8081:8081"
# # - "8053:53"
# # - "8053:53/udp"
dns:
- 10.151.40.100
mysql:
image: mariadb:10.4.7-bionic
networks:
default:
ipv4_address: 10.151.40.4
environment:
MYSQL_ROOT_PASSWORD: secret
dns:
- 10.151.40.100
depends_on:
- recursor
setup:
build:
context: ./test/
dockerfile: Dockerfile.setup
networks:
default:
ipv4_address: 10.151.40.200
dns:
- 10.151.40.100
depends_on:
- pdns
- recursor
- pebble
- acmedns
command:
- sh
- -c
- |
# check if pdns is ready
while true; do
echo "Checking if PDNS is up and responding ... "
if curl -s -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 -s -k -f https://pebble:14000/dir; then
break
fi
sleep 1
done
# check if acmedns is ready
while true; do
echo "Checking if ACME-DNS is up and responding ... "
if curl -s -f http://acmedns/health; then
break
fi
sleep 1
done
curl -s -X POST http://pdns:8081/api/v1/servers/localhost/zones \
-d '{"name": "acme.com.", "kind": "Native", "soa_edit_api": "", "nameservers": ["ns1.acme.com."]}' \
-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.acme.com."]}' \
-H "X-API-Key: secret"