-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
61 lines (54 loc) · 1.57 KB
/
docker-compose.yaml
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
services:
# https://medium.com/workleap/the-only-local-mongodb-replica-set-with-docker-compose-guide-youll-ever-need-2f0b74dd8384
mongosh:
image: docker.io/mongodb/mongodb-community-server:latest
entrypoint: mongosh mongodb://mongodb1:27017/?ssl=false -f /config/functions.js
command: -f /config/functions.js --shell
volumes:
- ./config:/config:ro
deploy:
replicas: 0
mongostat:
image: docker.io/mongodb/mongodb-community-server:latest
command: bash -c 'mongostat mongodb://mongodb1:27017/?ssl=false -o "$$(paste -sd, /config/mongostat.fields)"'
volumes:
- ./config:/config:ro
deploy:
replicas: 0
mongodb1:
image: docker.io/mongodb/mongodb-community-server:latest
ports:
- 27017:27017
mongodb_exporter:
image: percona/mongodb_exporter:0.43.1
command: --mongodb.uri=mongodb://mongodb1:27017/?ssl=false --collect-all
ports:
- 9216:9216
depends_on:
- mongodb1
prometheus:
extra_hosts:
- "host.docker.internal:host-gateway"
#- "host.docker.internal:172.17.0.1"
image: prom/prometheus:v2.37.9
command:
- '--config.file=/etc/prometheus/prometheus.yaml'
ports:
- 9090:9090
user: "0:0"
volumes:
- ./config:/etc/prometheus:ro
restart: unless-stopped
depends_on:
- mongodb_exporter
grafana:
image: grafana/grafana-oss:latest
ports:
- '3000:3000'
user: "0:0"
volumes:
- ./config:/etc/grafanax:ro
- ./config:/var/lib/grafana
restart: unless-stopped
depends_on:
- prometheus