-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
159 lines (151 loc) · 5.11 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
version: '3.7'
networks:
monitor-net:
driver: bridge
web:
external: true
volumes:
prometheus_data: {}
grafana_data: {}
services:
prometheus:
image: prom/prometheus:${PROMETHEUS_VERSION}
container_name: prometheus
volumes:
- ./prometheus:/etc/prometheus
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--storage.tsdb.retention.time=200h'
- '--web.enable-lifecycle'
restart: unless-stopped
ports:
- 9006:9090
networks:
- monitor-net
- web
labels:
- "traefik.enable=true"
- "traefik.http.routers.prometheus.rule=Host(`prometheus.${HTTP_HOST}`)"
- "traefik.http.routers.prometheus.tls=true"
- "traefik.http.routers.prometheus.entrypoints=websecure"
- "traefik.http.routers.prometheus.middlewares=authelia@docker"
- "traefik.http.routers.prometheus.tls.certresolver=lets-encrypt"
- "traefik.port=9090"
alertmanager:
image: prom/alertmanager:${ALERTMANAGER_VERSION}
container_name: alertmanager
volumes:
- ./alertmanager:/etc/alertmanager
command:
- '--config.file=/etc/alertmanager/config.yml'
- '--storage.path=/alertmanager'
restart: unless-stopped
ports:
- 9005:9093
networks:
- monitor-net
- web
labels:
- "traefik.enable=true"
- "traefik.http.routers.alertmanager.rule=Host(`alertmanager.${HTTP_HOST}`)"
- "traefik.http.routers.alertmanager.tls=true"
- "traefik.http.routers.alertmanager.entrypoints=websecure"
- "traefik.http.routers.alertmanager.middlewares=authelia@docker"
- "traefik.http.routers.alertmanager.tls.certresolver=lets-encrypt"
- "traefik.port=9093"
nodeexporter:
image: prom/node-exporter:${NODE_EXPORTER_VERSION}
container_name: nodeexporter
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
- /host/sys/class:/host/sys/class:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
restart: unless-stopped
ports:
- 9004:9100
networks:
- monitor-net
- web
labels:
- "traefik.enable=true"
- "traefik.http.routers.nodeexporter.rule=Host(`nodeexporter.${HTTP_HOST}`)"
- "traefik.http.routers.nodeexporter.tls=true"
- "traefik.http.routers.nodeexporter.entrypoints=websecure"
- "traefik.http.routers.nodeexporter.middlewares=authelia@docker"
- "traefik.http.routers.nodeexporter.tls.certresolver=lets-encrypt"
- "traefik.port=9100"
cadvisor:
image: gcr.io/cadvisor/cadvisor:${CADVISOR_VERSION}
container_name: cadvisor
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker:/var/lib/docker:ro
- /cgroup:/cgroup:ro #doesn't work on MacOS only for Linux
restart: unless-stopped
ports:
- 9003:8080
networks:
- monitor-net
- web
labels:
- "traefik.enable=true"
- "traefik.http.routers.cadvisor.rule=Host(`cadvisor.${HTTP_HOST}`)"
- "traefik.http.routers.cadvisor.tls=true"
- "traefik.http.routers.cadvisor.entrypoints=websecure"
- "traefik.http.routers.cadvisor.middlewares=authelia@docker"
- "traefik.http.routers.cadvisor.tls.certresolver=lets-encrypt"
- "traefik.port=8080"
grafana:
image: grafana/grafana:${GRAFANA_VERSION}
container_name: grafana
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
environment:
- GF_SECURITY_ADMIN_USER=${ADMIN_USER}
- GF_SECURITY_ADMIN_PASSWORD=${ADMIN_PASSWORD}
- GF_USERS_ALLOW_SIGN_UP=false
restart: unless-stopped
ports:
- 9002:3000
networks:
- monitor-net
- web
labels:
- "traefik.enable=true"
- "traefik.http.routers.grafana.rule=Host(`grafana.${HTTP_HOST}`)"
- "traefik.http.routers.grafana.tls=true"
- "traefik.http.routers.grafana.entrypoints=websecure"
- "traefik.http.routers.grafana.middlewares=authelia@docker"
- "traefik.http.routers.grafana.tls.certresolver=lets-encrypt"
- "traefik.port=3000"
pushgateway:
image: prom/pushgateway:${PUSH_GATEWAY_VERSION}
container_name: pushgateway
restart: unless-stopped
ports:
- 9001:9091
networks:
- monitor-net
- web
labels:
- "traefik.enable=true"
- "traefik.http.routers.pushgateway.rule=Host(`pushgateway.${HTTP_HOST}`)"
- "traefik.http.routers.pushgateway.tls=true"
- "traefik.http.routers.pushgateway.entrypoints=websecure"
- "traefik.http.routers.pushgateway.middlewares=authelia@docker"
- "traefik.http.routers.pushgateway.tls.certresolver=lets-encrypt"
- "traefik.port=9091"