-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
89 lines (84 loc) · 2.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
version: '3.3'
services:
nodeexporter:
image: prom/node-exporter:v1.1.1
container_name: 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.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)'
- '--no-collector.rapl'
restart: unless-stopped
ports:
- ${NODE_EXPORTER_PORT:-9100}:9100
labels:
group: "monitoring"
host.name: "${HOST_NAME}"
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
container_name: cadvisor
volumes:
- /:/rootfs:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker:/var/lib/docker:ro
- /sys/fs/cgroup:/cgroup:ro
- /dev/disk/:/dev/disk:ro
command:
- '-housekeeping_interval=10s'
- '-docker_only=true'
restart: unless-stopped
devices:
- /dev/kmsg:/dev/kmsg
security_opt:
- no-new-privileges:true
ports:
- ${CADVISOR_PORT:-8080}:8080
labels:
group: "monitoring"
host.name: "${HOST_NAME}"
nginxexporter:
image: nginx/nginx-prometheus-exporter:latest
container_name: nginxexporter
command:
- '-nginx.scrape-uri=${NGINX_SCRAPE_URI:-http://localhost:8087/nginx_status}'
- '-prometheus.const-labels=host=${HOST_NAME}'
restart: unless-stopped
ports:
- ${NGINX_EXPORTER_PORT}:9113
extra_hosts:
- "host.docker.internal:${DOCKER_HOST_INTERNAL_IP}"
labels:
group: "monitoring"
host.name: "${HOST_NAME}"
promtail:
image: grafana/promtail:2.1.0
container_name: promtail
environment:
- HOST_NAME
- LOKI_EXTERNAL_URL
- LOKI_USERNAME
- LOKI_PASSWORD
- APP_LOG_SELECTOR
- APP_MATCH_REGEX
- APP_MATCH_LABELS
volumes:
- ./promtail/promtail.yml:/etc/promtail/promtail.yml
- promtail_data:/promtail/
- /var/log:/var/log:ro
- ${APP_LOG_DIR}:/app/log:ro # Remove this line if there is no app logs to read
command:
- '-config.file=/etc/promtail/promtail.yml'
- '-config.expand-env=true'
restart: unless-stopped
labels:
group: "monitoring"
host.name: "${HOST_NAME}"
volumes:
promtail_data: {}