-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.min.yml
266 lines (255 loc) · 10.1 KB
/
docker-compose.min.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
version: '3.7'
#================================================================================================
# NETWORK SETUP
#================================================================================================
networks:
nfndp-net:
name: nfndp-net
driver: bridge
ipam:
config:
- subnet: 172.215.0.0/16
#================================================================================================
# VOLUME SETUP
#================================================================================================
volumes:
vol_consul:
driver: ${VOLUMES_DRIVER:-local}
driver_opts:
o: bind
type: none
device: ${DATA_CONSUL:-/opt/data/docker/consul}
vol_grafana:
driver: ${VOLUMES_DRIVER:-local}
driver_opts:
o: bind
type: none
device: ${DATA_GRAFANA:-/opt/data/docker/grafana}
vol_portainer:
driver: ${VOLUMES_DRIVER:-local}
driver_opts:
o: bind
type: none
device: ${DATA_PORTAINER:-/opt/data/docker/portainer}
vol_prometheus:
driver: ${VOLUMES_DRIVER:-local}
driver_opts:
o: bind
type: none
device: ${DATA_PROMETHEUS:-/opt/data/docker/prometheus}
services:
#================================================================================================
# PORTAINER
#================================================================================================
portainer:
image: dockerframework/portainer:${PORTAINER_VERSION:-2.9}
container_name: ${CONTAINER_PORTAINER:-nfndp_portainer}
restart: unless-stopped
ports:
- "${PORT_PORTAINER:-5212}:9000"
volumes:
# - /etc/localtime:/etc/localtime:ro ## Do not use it in mac
- /var/run/docker.sock:/var/run/docker.sock ## Do not use it in k8s
- ${DATA_PORTAINER:-/opt/data/docker/portainer}:/data
environment:
- PORTAINER_TEMPLATE=generic
- PORTAINER_VERSION=${PORTAINER_VERSION:-2.9}
privileged: true
tty: true
networks:
nfndp-net:
ipv4_address: ${CONTAINER_IP_PORTAINER:-172.215.148.16}
#================================================================================================
# CORE-CONSUL
#================================================================================================
consul:
image: consul:${CONSUL_VERSION:-1.15.4}
container_name: ${CONTAINER_PORTAINER:-nfndp_consul}
restart: unless-stopped
ports:
- "${PORT_CONSUL:-8500}:8500"
volumes:
# - /etc/localtime:/etc/localtime:ro ## Do not use it in mac
- /var/run/docker.sock:/var/run/docker.sock ## Do not use it in k8s
environment:
- CONSUL_VERSION=${CONSUL_VERSION:-1.15.4}
- CONSULTEMPLATE_VERSION=${CONSULTEMPLATE_VERSION:-0.19.4}
- CONSUL_OPTIONS=-server -bootstrap-expect 1 -client 0.0.0.0 -ui # minimal server options
privileged: true
tty: true
networks:
nfndp-net:
ipv4_address: ${CONTAINER_IP_CONSUL:-172.215.0.3}
#================================================================================================
# ALERTMANAGER
#================================================================================================
alertmanager:
image: prom/alertmanager:v0.14.0
container_name: ${CONTAINER_ALERTMANAGER:-nfndp_alertmanager}
restart: unless-stopped
volumes:
# - /etc/localtime:/etc/localtime:ro ## Do not use it in mac
- /var/run/docker.sock:/var/run/docker.sock ## Do not use it in k8s
- ./config/alertmanager/:/etc/alertmanager/
command:
- '--config.file=/etc/alertmanager/config.yml'
- '--storage.path=/alertmanager'
ports:
- "${ALERTMANAGER_PORT:-8300}:9093"
privileged: true
tty: true
networks:
nfndp-net:
ipv4_address: ${CONTAINER_IP_ALERTMANAGER:-172.215.0.5}
#================================================================================================
# CADDY
#================================================================================================
caddy:
image: stefanprodan/caddy:latest
container_name: ${CONTAINER_CADDY:-nfndp_caddy}
restart: unless-stopped
ports:
- "${CADDY_PORT1:-8301}:3000"
- "${CADDY_PORT2:-8302}:9090"
- "${CADDY_PORT3:-8303}:9091"
- "${CADDY_PORT4:-8304}:9093"
volumes:
# - /etc/localtime:/etc/localtime:ro ## Do not use it in mac
- /var/run/docker.sock:/var/run/docker.sock ## Do not use it in k8s
- ./config/caddy/:/etc/caddy/
environment:
- ADMIN_USER=nfndp
- ADMIN_PASSWORD=password
privileged: true
tty: true
networks:
nfndp-net:
ipv4_address: ${CONTAINER_IP_CADDY:-172.215.0.6}
#================================================================================================
# CADVISOR
#================================================================================================
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
container_name: ${CONTAINER_CADVISOR:-nfndp_cadvisor}
restart: unless-stopped
volumes:
# - /etc/localtime:/etc/localtime:ro ## Do not use it in mac
- /var/run/docker.sock:/var/run/docker.sock ## Do not use it in k8s
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/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
ports:
- "${CADVISOR_PORT:-8305}:3000"
privileged: true
tty: true
networks:
nfndp-net:
ipv4_address: ${CONTAINER_IP_CADVISOR:-172.215.0.7}
#================================================================================================
# GRAFANA
#================================================================================================
grafana:
build:
context: ./services/grafana/${GRAFANA_VERSION:-5.3.4}
container_name: ${CONTAINER_GRAFANA:-nfndp_grafana}
restart: unless-stopped
ports:
- "${GRAFANA_PORT:-8120}:3000"
volumes:
# - /etc/localtime:/etc/localtime:ro ## Do not use it in mac
- /var/run/docker.sock:/var/run/docker.sock ## Do not use it in k8s
- ${DATA_GRAFANA:-/opt/data/docker/grafana}:/var/lib/grafana # volume for data
environment:
- GRAFANA_VERSION=${GRAFANA_VERSION:-5.3.4}
#- GF_SERVER_ROOT_URL=${GF_SERVER_ROOT_URL:-http://localhost:8108}
- GF_SECURITY_ADMIN_USER=${GF_SECURITY_ADMIN_USER:-nfndp}
- GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD:-password}
- GF_INSTALL_PLUGINS=${GF_INSTALL_PLUGINS:-grafana-clock-panel,grafana-simple-json-datasource,grafana-kubernetes-app,grafana-worldmap-panel,percona-percona-app}
#- GF_AWS_PROFILES=${GF_AWS_PROFILES}
#- GF_AWS_default_ACCESS_KEY_ID=${GF_AWS_default_ACCESS_KEY_ID}
#- GF_AWS_default_SECRET_ACCESS_KEY=${GF_AWS_default_SECRET_ACCESS_KEY}
#- GF_AWS_default_REGION=${GF_AWS_default_REGION}
privileged: true
tty: true
networks:
nfndp-net:
ipv4_address: ${CONTAINER_IP_GRAFANA:-172.215.0.8}
#================================================================================================
# NODEEXPORTER
#================================================================================================
nodeexporter:
image: prom/node-exporter:latest
#image: prom/node-exporter:v1.4.1
container_name: ${CONTAINER_NODEEXPORTER:-nfndp_nodeexporter}
restart: unless-stopped
ports:
- "${NODEEXPORTER_PORT:-8306}:9100"
volumes:
# - /etc/localtime:/etc/localtime:ro ## Do not use it in mac
- /var/run/docker.sock:/var/run/docker.sock ## Do not use it in k8s
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/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
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)'
user: root
privileged: true
tty: true
networks:
nfndp-net:
ipv4_address: ${CONTAINER_IP_NODEEXPORTER:-172.215.0.12}
#================================================================================================
# PROMETHEUS
#================================================================================================
prometheus:
build:
context: ./services/prometheus/${PROMETHEUS_VERSION:-2.5.0}
container_name: ${CONTAINER_PROMETHEUS:-nfndp_prometheus}
restart: unless-stopped
volumes:
# - /etc/localtime:/etc/localtime:ro ## Do not use it in mac
- /var/run/docker.sock:/var/run/docker.sock ## Do not use it in k8s
- ./config/prometheus/alert.rules:/etc/prometheus/alert.rules
- ./config/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ${DATA_PROMETHEUS:-/opt/data/docker/prometheus}:/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=200h'
- '--web.enable-lifecycle'
ports:
- "${PROMETHEUS_PORT:-8307}:9090"
privileged: true
tty: true
networks:
nfndp-net:
ipv4_address: ${CONTAINER_IP_NODEEXPORTER:-172.215.0.18}
#================================================================================================
# PUSHGATEWAY
#================================================================================================
pushgateway:
image: prom/pushgateway:latest
container_name: ${CONTAINER_PUSHGATEWAY:-nfndp_pushgateway}
restart: unless-stopped
ports:
- "${PUSHGATEWAY_PORT:-8308}:9091"
volumes:
# - /etc/localtime:/etc/localtime:ro ## Do not use it in mac
- /var/run/docker.sock:/var/run/docker.sock ## Do not use it in k8s
privileged: true
tty: true
networks:
nfndp-net:
ipv4_address: ${CONTAINER_IP_PUSHGATEWAY:-172.215.0.19}