-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
139 lines (126 loc) · 3.4 KB
/
compose.yaml
File metadata and controls
139 lines (126 loc) · 3.4 KB
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
services:
grafana:
restart: always
image: ${GRAFANA_IMAGE_NAME}:${GRAFANA_IMAGE_TAG}
container_name: ${GRAFANA_CONTAINER_NAME}
hostname: ${GRAFANA_HOSTNAME}
networks:
grafana:
ports:
- "3000:3000"
environment:
# - GF_SERVER_ROOT_URL=${GF_SERVER_ROOT_URL}
- GF_INSTALL_PLUGINS=${GF_INSTALL_PLUGINS}
- GF_FEATURE_TOGGLES_ENABLE=${GF_FEATURE_TOGGLES_ENABLE}
- GF_DEFAULT_INSTANCE_NAME=${GF_DEFAULT_INSTANCE_NAME}
- GF_SECURITY_ADMIN_USER=${GF_SECURITY_ADMIN_USER}
volumes:
# predefine datasources
- grafana-datasources:/etc/grafana/provisioning/datasources
- grafana-dashboards:/etc/grafana/provisioning/dashboards
- grafana-data:/var/lib/grafana
- grafana-logs:/etc/grafana/logs
command:
# - --config=/etc/grafana/grafana_custom.ini
- cfg:default.paths.logs=/etc/grafana/logs
depends_on:
prometheus:
condition: service_healthy
## Uncomment if use in Linux, comment winexporter below
node-exporter:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://0.0.0.0:3000"]
start_period: 5s
interval: 30s
retries: 3
timeout: 5s
prometheus:
restart: always
image: ${PROMETHEUS_IMAGE_NAME}:${PROMETHEUS_IMAGE_TAG}
container_name: ${PROMETHEUS_CONTAINER_NAME}
hostname: ${PROMETHEUS_HOSTNAME}
networks:
grafana:
# expose:
# - 9090
ports:
- "9090:9090"
volumes:
- prom-data:/prometheus
- prom-configs:/etc/prometheus
healthcheck:
test: "wget --no-verbose --tries=3 --spider http://0.0.0.0:9090/metrics || exit 1"
start_period: 5s
interval: 30s
retries: 3
timeout: 5s
node-exporter:
restart: always
image: ${NODE_IMAGE_NAME}:${NODE_IMAGE_TAG}
container_name: ${NODE_CONTAINER_NAME}
hostname: ${NODE_HOSTNAME}
networks:
grafana:
# expose:
# - 9100
ports:
- "9100:9100"
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude'
- '^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)'
healthcheck:
test: "wget --no-verbose --tries=3 --spider http://0.0.0.0:9100/metrics || exit 1"
start_period: 5s
interval: 30s
retries: 3
timeout: 5s
networks:
grafana:
volumes:
# --> Grafana volumes
grafana-data:
driver: local
driver_opts:
type: "none"
o: "bind"
device: "./data/grafana/data"
grafana-logs:
driver: local
driver_opts:
type: "none"
o: "bind"
device: "./data/grafana/logs"
grafana-datasources:
driver: local
driver_opts:
type: "none"
o: "bind"
device: "./data/grafana/datasources"
grafana-dashboards:
driver: local
driver_opts:
type: "none"
o: "bind"
device: "./data/grafana/dashboards"
# <-- Grafana volumes
# --> Prometheus volumes
prom-data:
driver: local
driver_opts:
type: "none"
o: "bind"
device: "./data/prometheus/data"
prom-configs:
driver: local
driver_opts:
type: "none"
o: "bind"
device: "./data/prometheus/configs"
# <-- Prometheus volumes