-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
113 lines (104 loc) · 2.87 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
version: "3.9"
networks:
default:
external:
name: traefik
volumes:
grafana-storage:
prometheus-storage:
x-restart-policy: &restart-policy
restart: unless-stopped
services:
grafana:
<<: *restart-policy
image: grafana/grafana:9.3.1
container_name: ${DEPLOY_PATH}_grafana
env_file: .env
depends_on:
- loki
- prometheus
volumes:
- grafana-storage:/var/lib/grafana
- ./datasource.yaml:/etc/grafana/provisioning/datasources/monitoring.yaml
labels:
- "traefik.enable=true"
- "traefik.subdomain=${DEPLOY_PATH}"
- "traefik.http.services.${DEPLOY_PATH}.loadbalancer.server.port=3000"
- "traefik.http.routers.${DEPLOY_PATH}.tls.certresolver=letsEncrypt"
prometheus:
<<: *restart-policy
image: prom/prometheus
container_name: ${DEPLOY_PATH}_prometheus
depends_on:
- node-exporter
- cadvisor
- promtail
volumes:
- prometheus-storage:/prometheus
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
command:
- --enable-feature=expand-external-labels
- --storage.tsdb.retention.time=7d
- --config.file=/etc/prometheus/prometheus.yml
- --web.enable-lifecycle
expose:
- 9090
node-exporter:
<<: *restart-policy
image: prom/node-exporter
container_name: ${DEPLOY_PATH}_nodeExporter
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- --path.procfs=/host/proc
- --path.rootfs=/rootfs
- --path.sysfs=/host/sys
- --collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
expose:
- 9100
cadvisor:
<<: *restart-policy
image: gcr.io/cadvisor/cadvisor
container_name: ${DEPLOY_PATH}_cAdvisor
privileged: true
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
expose:
- 8080
loki:
image: grafana/loki:2.6.1
container_name: ${DEPLOY_PATH}_loki
volumes:
- ./loki.yml:/etc/loki/local-config.yml
command:
- --config.file=/etc/loki/local-config.yml
- --ruler.storage.type=local
- --ruler.storage.local.directory=/tmp/loki/rules
expose:
- 3100
labels:
- "traefik.enable=true"
- "traefik.subdomain=loki"
- "traefik.http.services.loki.loadbalancer.server.port=3100"
- "traefik.http.routers.loki.tls.certresolver=letsEncrypt"
promtail:
<<: *restart-policy
image: grafana/promtail:2.6.1
container_name: ${DEPLOY_PATH}_promtail
env_file: .env
depends_on:
- loki
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./promtail-config.yaml:/etc/promtail/promtail-config.yaml
command:
- --config.file=/etc/promtail/promtail-config.yaml
- -config.expand-env=true
- -print-config-stderr
expose:
- 9080