-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathdocker-compose.yml
154 lines (142 loc) · 3.34 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
version: "3.8"
x-pm-settings:
- &LETS_ENCRYPT_EMAIL "${LETS_ENCRYPT_EMAIL?Please provide an email for let's encrypt}" # Replace with your email address or create a .env file
- &PDNS_MYSQL_ROOT_PASSWORD "pdns"
- &PDNS_MYSQL_DATABASE "pdns"
- &PDNS_API_KEY "pdns-secret"
services:
##
# DNS
##
powerdns-db:
container_name: pm_powerdns-db
image: mariadb@sha256:0c3c560359a6da112134a52122aa9b78fec5f9dd292a01ee7954de450f25f0c1
environment:
MYSQL_ROOT_PASSWORD: *PDNS_MYSQL_ROOT_PASSWORD
MYSQL_DATABASE: *PDNS_MYSQL_DATABASE
networks:
- dns-net
volumes:
- powerdns-data:/var/lib/mysql
restart: unless-stopped
powerdns:
container_name: pm_powerdns
build:
context: ./dockers/powerdns
args:
API_KEY: *PDNS_API_KEY
ports:
- "53:53"
- "53:53/udp"
environment:
MYSQL_HOST: powerdns-db
MYSQL_USER: "root"
MYSQL_PASSWORD: *PDNS_MYSQL_ROOT_PASSWORD
MYSQL_DATABASE: *PDNS_MYSQL_DATABASE
depends_on:
- powerdns-db
networks:
- dns-net
volumes:
- powerdns-logs:/logs/pdns
restart: unless-stopped
##
# TRAEFIK
##
redis:
container_name: pm_redis
image: redis
networks:
- redis-net
command: ["redis-server", "--appendonly", "yes"]
volumes:
- redis-data:/data
restart: unless-stopped
traefik:
container_name: pm_traefik
build:
context: ./dockers/traefik
args:
LETS_ENCRYPT_EMAIL: *LETS_ENCRYPT_EMAIL
ports:
- "80:80"
- "443:443"
volumes:
- traefik-data:/data:rw
- traefik-logs:/logs/traefik
environment:
TRAEFIK_PROVIDERS_REDIS_ENDPOINTS: "redis:6379"
TRAEFIK_PROVIDERS_REDIS_ROOTKEY: "traefik"
PDNS_API_KEY: *PDNS_API_KEY
PDNS_API_URL: "http://powerdns:8081/"
depends_on:
- redis
- powerdns
networks:
- traefik-net
- dns-net
- redis-net
restart: unless-stopped
##
# LOGBEAT
##
logbeat:
container_name: pm_logbeat
build:
context: ./dockers/logbeat
user: root
network_mode: none
volumes:
- /var/lib/docker:/var/lib/docker:ro
- /var/run/docker.sock:/var/run/docker.sock
- powerdns-logs:/logs/pdns
- traefik-logs:/logs/traefik
- all-logs:/logs/all
restart: unless-stopped
##
# Manager
##
manager:
container_name: pm_manager
image: "pm-manager"
build:
context: ./dockers/manager
depends_on:
- powerdns
- redis
- traefik
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "/var/lib/docker/volumes:/var/lib/docker/volumes"
- all-logs:/logs/all
environment:
PM_REDIS_HOST: "redis://redis"
PM_TRAEFIK_HTTP_API: "http://traefik:8080/api"
PM_TRAEFIK_REDIS_ROOT: "traefik"
PM_POWERDNS_HTTP_API: "http://powerdns:8081"
PM_POWERDNS_HTTP_API_KEY: *PDNS_API_KEY
networks:
- redis-net
- dns-net
- traefik-net
restart: unless-stopped
volumes:
powerdns-logs:
name: powerdns-logs
powerdns-data:
name: powerdns-data
redis-data:
name: redis-data
traefik-data:
name: traefik-data
traefik-logs:
name: traefik-logs
all-logs:
name: all-logs
networks:
redis-net:
name: pm_redis-net
dns-net:
name: pm_dns-net
traefik-net:
name: pm_traefik-net