-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathdocker-compose.mongo.rs.yml
More file actions
67 lines (63 loc) · 2.02 KB
/
docker-compose.mongo.rs.yml
File metadata and controls
67 lines (63 loc) · 2.02 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
#version '3.8'
services:
mongo_primary:
image: bitnami/mongodb:latest
container_name: mongo_primary
environment:
- TZ=Asia/Chongqing
- MONGODB_ADVERTISED_HOSTNAME=host.docker.internal
- MONGODB_REPLICA_SET_MODE=primary
- MONGODB_REPLICA_SET_NAME=rs0
- MONGODB_ROOT_USER=joe
- MONGODB_ROOT_PASSWORD=a123456
- MONGODB_REPLICA_SET_KEY=HxplckY2jXSwfDRE
ports:
- "27017:27017"
extra_hosts:
- "host.docker.internal:host-gateway"
- "gateway.docker.internal:host-gateway"
volumes:
- "mongodb_master_data:/bitnami/mongodb"
mongo_secondary:
image: bitnami/mongodb:latest
container_name: mongo_secondary
depends_on:
- mongo_primary
environment:
- TZ=Asia/Chongqing
- MONGODB_ADVERTISED_HOSTNAME=host.docker.internal
- MONGODB_REPLICA_SET_MODE=secondary
- MONGODB_REPLICA_SET_NAME=rs0
- MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017
- MONGODB_INITIAL_PRIMARY_HOST=host.docker.internal
- MONGODB_INITIAL_PRIMARY_ROOT_USER=joe
- MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=a123456
- MONGODB_REPLICA_SET_KEY=HxplckY2jXSwfDRE
ports:
- "27018:27017"
extra_hosts:
- "host.docker.internal:host-gateway"
- "gateway.docker.internal:host-gateway"
mongo_arbiter:
image: bitnami/mongodb:latest
container_name: mongo_arbiter
depends_on:
- mongo_primary
environment:
- TZ=Asia/Chongqing
- MONGODB_ADVERTISED_HOSTNAME=host.docker.internal
- MONGODB_REPLICA_SET_MODE=arbiter
- MONGODB_REPLICA_SET_NAME=rs0
- MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017
- MONGODB_INITIAL_PRIMARY_HOST=host.docker.internal
- MONGODB_INITIAL_PRIMARY_ROOT_USER=joe
- MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=a123456
- MONGODB_REPLICA_SET_KEY=HxplckY2jXSwfDRE
ports:
- "27019:27017"
extra_hosts:
- "host.docker.internal:host-gateway"
- "gateway.docker.internal:host-gateway"
volumes:
mongodb_master_data:
driver: local