-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathdocker-compose.yml
214 lines (214 loc) · 7.39 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
version: "3.6"
x-anchors:
# The name of the configured Traefik TLS cert resolver (defaulting to LE staging environment if not set).
traefik_cert_resolver: &traefik_cert_resolver "${TRAEFIK_CERT_RESOLVER:-}"
services:
webserver:
build:
context: ./webserver
environment:
HIGHSCORES_SERVICE_URL: "http://highscores_service:8181"
INTERNAL_DRAGON_URL: "http://static-data-service:8080"
PUBLIC_DRAGON_URL: "https://dragon.${SITE_DOMAIN}"
ANNOUNCEMENT_MESSAGE:
ANNOUNCEMENT_LINK:
SITE_URL: "https://${SITE_DOMAIN}"
labels:
traefik.enable: true
traefik.http.services.webserver.loadbalancer.server.port: 8080
traefik.http.routers.webserver.rule: &webserver_rule "Host(`${SITE_DOMAIN}`, `www.${SITE_DOMAIN}`)"
traefik.http.routers.webserver.entrypoints: "https"
traefik.http.routers.webserver.tls.certResolver: *traefik_cert_resolver
traefik.http.routers.webserver_redirect.rule: *webserver_rule
traefik.http.routers.webserver_redirect.entrypoints: "http"
traefik.http.routers.webserver_redirect.middlewares: "https_redirect@file"
networks:
traefik:
highscoresService:
depends_on:
- "static-data-service"
restart: unless-stopped
highscores_service:
build:
context: "./highscores-service"
environment:
MYSQL_CONNECTION_URL: "jdbc:${MYSQL_CONNECTION_URL}"
RIOT_API_KEY:
networks:
mysql:
prometheus:
highscoresService:
depends_on:
- "mysql"
restart: unless-stopped
traefik:
build:
context: "./traefik"
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "acmeCerts:/acme/"
labels:
traefik.enable: true
traefik.http.routers.traefik_api.service: "api@internal"
traefik.http.routers.traefik_api.rule: &traefik_api_rule "Host(`traefik.admin.${SITE_DOMAIN}`, `www.traefik.admin.${SITE_DOMAIN}`)"
traefik.http.routers.traefik_api.entrypoints: "https"
traefik.http.routers.traefik_api.tls.certResolver: *traefik_cert_resolver
traefik.http.routers.traefik_api.middlewares: "admin_panel_auth"
traefik.http.middlewares.admin_panel_auth.basicauth.removeHeader: true
traefik.http.middlewares.admin_panel_auth.basicauth.users: "${ADMIN_HTPASSWD}"
traefik.http.routers.traefik_api_redirect.rule: *traefik_api_rule
traefik.http.routers.traefik_api_redirect.entrypoints: "http"
traefik.http.routers.traefik_api_redirect.middlewares: "https_redirect@file"
networks:
traefik:
prometheus:
restart: unless-stopped
prometheus:
build:
context: "./prometheus"
command: "--storage.tsdb.path=/prometheus/prometheus_data --config.file=/etc/prometheus/prometheus.yml"
volumes:
- "prometheusData:/prometheus/prometheus_data/"
labels:
traefik.enable: true
traefik.http.services.prometheus.loadbalancer.server.port: 9090
traefik.http.routers.prometheus.rule: &prometheus_rule "Host(`prometheus.admin.${SITE_DOMAIN}`, `www.prometheus.admin.${SITE_DOMAIN}`)"
traefik.http.routers.prometheus.entrypoints: "https"
traefik.http.routers.prometheus.tls.certResolver: *traefik_cert_resolver
traefik.http.routers.prometheus.middlewares: "admin_panel_auth"
traefik.http.routers.prometheus_redirect.rule: *prometheus_rule
traefik.http.routers.prometheus_redirect.entrypoints: "http"
traefik.http.routers.prometheus_redirect.middlewares: "https_redirect@file"
networks:
traefik:
prometheus:
# Necessary to access data directory.
user: "root"
restart: unless-stopped
cadvisor:
image: "gcr.io/cadvisor/cadvisor:latest"
volumes:
- "/:/rootfs:ro,rslave"
- "/var/run:/var/run:ro"
- "/sys:/sys:ro"
- "/var/lib/docker/:/var/lib/docker:ro,rslave"
- "/dev/disk/:/dev/disk:ro"
networks:
prometheus:
restart: unless-stopped
node_exporter:
image: "prom/node-exporter:latest"
networks:
prometheus:
restart: unless-stopped
grafana:
build:
context: "./grafana"
labels:
traefik.enable: true
traefik.http.services.grafana.loadbalancer.server.port: 3000
traefik.http.routers.grafana.rule: &grafana_rule "Host(`grafana.admin.${SITE_DOMAIN}`, `www.grafana.admin.${SITE_DOMAIN}`)"
traefik.http.routers.grafana.entrypoints: "https"
traefik.http.routers.grafana.tls.certResolver: *traefik_cert_resolver
traefik.http.routers.grafana.middlewares: "admin_panel_auth"
traefik.http.routers.grafana_redirect.rule: *grafana_rule
traefik.http.routers.grafana_redirect.entrypoints: "http"
traefik.http.routers.grafana_redirect.middlewares: "https_redirect@file"
networks:
traefik:
prometheus:
restart: unless-stopped
admin_ui:
build:
context: "./admin_ui"
labels:
traefik.enable: true
traefik.http.services.admin_ui.loadbalancer.server.port: 80
traefik.http.routers.admin_ui.rule: &admin_ui_rule "Host(`admin.${SITE_DOMAIN}`, `www.admin.${SITE_DOMAIN}`)"
traefik.http.routers.admin_ui.entrypoints: "https"
traefik.http.routers.admin_ui.tls.certResolver: *traefik_cert_resolver
traefik.http.routers.admin_ui_redirect.rule: *admin_ui_rule
traefik.http.routers.admin_ui_redirect.entrypoints: "http"
traefik.http.routers.admin_ui_redirect.middlewares: "https_redirect@file"
networks:
traefik:
restart: unless-stopped
mysql:
build:
context: "./mysql/"
args:
MYSQL_ROOT_PASSWORD:
ports:
- "3306:3306"
volumes:
- "mysqlData:/mysql_data"
environment:
MYSQL_ROOT_PASSWORD:
networks:
mysql:
prometheus:
restart: unless-stopped
cap_add:
- SYS_NICE
prom_mysql_exporter:
image: "prom/mysqld-exporter:v0.11.0"
environment:
DATA_SOURCE_NAME: "root:${MYSQL_ROOT_PASSWORD}@(mysql)/"
networks:
prometheus:
restart: unless-stopped
static-data-service:
build:
context: ./static-data-service
volumes:
- "staticData:/cmgg/staticData/"
labels:
traefik.enable: true
traefik.http.services.dragon.loadbalancer.server.port: 8080
traefik.http.routers.dragon.rule: &webserver_rule "Host(`dragon.${SITE_DOMAIN}`, `www.dragon.${SITE_DOMAIN}`)"
traefik.http.routers.dragon.entrypoints: "https"
traefik.http.routers.dragon.tls.certResolver: *traefik_cert_resolver
traefik.http.routers.dragon_redirect.rule: *webserver_rule
traefik.http.routers.dragon_redirect.entrypoints: "http"
traefik.http.routers.dragon_redirect.middlewares: "https_redirect@file"
networks:
traefik:
highscoresService:
restart: unless-stopped
healthcheck:
build:
context: ./healthcheck
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
networks:
highscoresService:
depends_on:
- "highscores_service"
restart: unless-stopped
freshness_automation:
build:
context: ./freshness_automation
environment:
MYSQL_USER: "root"
MYSQL_PASSWORD: "${MYSQL_ROOT_PASSWORD}"
MYSQL_HOST: "mysql"
HIGHSCORES_SERVICE_URL: "http://highscores_service:8181"
networks:
mysql:
highscoresService:
depends_on:
- "highscores_service"
restart: unless-stopped
volumes:
staticData:
acmeCerts:
prometheusData:
mysqlData:
networks:
traefik:
prometheus:
mysql:
highscoresService: