-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmongo.yml
52 lines (47 loc) · 1.16 KB
/
mongo.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
# docker compose -f ./mongo.yml -p mongo up -d
version: '3.8'
networks:
devnet:
external: true
services:
mongo:
image: mongo:latest
container_name: mongodb
restart: "unless-stopped"
ports:
- 27017:27017
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo mongo:27017/test --quiet
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
networks:
- devnet
mongo_exporter:
image: gpuliyar/mongo-exporter
container_name: mongo-exporter
restart: "unless-stopped"
ports:
- 9001:9001
environment:
- 'MONGO_SERVICE=mongodb'
- 'MONGO_PORT=27017'
depends_on:
- mongo
networks:
- devnet
mongo_query_exporter:
image: ghcr.io/raffis/mongodb-query-exporter:v1.0.0
container_name: mongo-query-exporter
restart: "unless-stopped"
ports:
- 9412:9412
volumes:
- ./mongodb_query_exporter/:/etc/mongodb_query_exporter/
environment:
- 'MDBEXPORTER_MONGODB_URI=mongodb://mongodb:27017'
- 'MDBEXPORTER_LOG_ENCODING=json'
- 'MDBEXPORTER_CONFIG=/etc/mongodb_query_exporter/config.yaml'
networks:
- devnet