-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathdocker-compose.yml
110 lines (104 loc) · 2.6 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
version: '3.7'
services:
nginx:
build:
context: ./nginx
target: dev
container_name: nginx-www
restart: always
volumes:
- ./html:/usr/share/nginx/html:rw
- ./nginx/conf:/etc/nginx/conf.d
- ./nginx/log:/var/log/nginx
networks:
- localhost
ports:
- 80:80
- 443:443
# source https://prometheus.io/docs/prometheus/latest/installation/
prometheus:
image: prom/prometheus:v2.45.2
user: root
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./prometheus/data:/prometheus
container_name: prometheus
restart: always
networks:
- localhost
ports:
- 9090:9090
# source https://github.com/nginxinc/nginx-prometheus-exporter
nginx-prometheus-exporter:
image: nginx/nginx-prometheus-exporter:1.0
container_name: prometheus-nginx-exporter
restart: always
env_file:
.env
command:
- -nginx.scrape-uri=https://nginx/stub_status
expose:
- 9113
networks:
- localhost
depends_on:
- prometheus
# source https://github.com/prometheus/node_exporter
# https://github.com/vegasbrianc/prometheus/
prometheus-node-exporter:
image: prom/node-exporter:v1.7.0
container_name: prometheus-node-exporter
restart: always
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- --collector.filesystem.ignored-mount-points
- "^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)"
networks:
- localhost
privileged: true
depends_on:
- prometheus
expose:
- 9100
# source https://grafana.com/docs/grafana/latest/installation/docker/
grafana:
image: grafana/grafana:10.0.10
container_name: grafana
restart: always
depends_on:
- prometheus
volumes:
- ./grafana/data:/var/lib/grafana
env_file:
- .env
networks:
- localhost
ports:
- 3000:3000
user: root
# source: https://github.com/google/cadvisor
cadvisor:
image: gcr.io/cadvisor/cadvisor:v0.47.2
container_name: cadvisor
restart: always
depends_on:
- prometheus
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
expose:
- 8080
networks:
- localhost
networks:
localhost:
name: localhost
external: false