-
Notifications
You must be signed in to change notification settings - Fork 12
/
docker-compose.mongo.rs.yml
51 lines (47 loc) · 1.52 KB
/
docker-compose.mongo.rs.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
#version '3.8'
services:
mongodb_primary:
image: bitnami/mongodb:latest
environment:
- TZ=Asia/Shanghai
- MONGODB_ADVERTISED_HOSTNAME=mongodb_primary
- MONGODB_REPLICA_SET_MODE=primary
- MONGODB_REPLICA_SET_NAME=rs1
- MONGODB_ROOT_USER=joe
- MONGODB_ROOT_PASSWORD=a123456
- MONGODB_REPLICA_SET_KEY=HxplckY2jXSwfDRE
ports:
- 27017:27017
volumes:
- "mongodb_master_data:/bitnami/mongodb"
mongodb_secondary:
image: bitnami/mongodb:latest
depends_on:
- mongodb_primary
environment:
- TZ=Asia/Shanghai
- MONGODB_ADVERTISED_HOSTNAME=mongodb_secondary
- MONGODB_REPLICA_SET_MODE=secondary
- MONGODB_REPLICA_SET_NAME=rs1
- MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017
- MONGODB_INITIAL_PRIMARY_HOST=mongodb_primary
- MONGODB_INITIAL_PRIMARY_ROOT_USER=joe
- MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=a123456
- MONGODB_REPLICA_SET_KEY=HxplckY2jXSwfDRE
mongodb_arbiter:
image: bitnami/mongodb:latest
depends_on:
- mongodb_primary
environment:
- TZ=Asia/Shanghai
- MONGODB_ADVERTISED_HOSTNAME=mongodb_arbiter
- MONGODB_REPLICA_SET_MODE=arbiter
- MONGODB_REPLICA_SET_NAME=rs1
- MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017
- MONGODB_INITIAL_PRIMARY_HOST=mongodb_primary
- MONGODB_INITIAL_PRIMARY_ROOT_USER=joe
- MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=a123456
- MONGODB_REPLICA_SET_KEY=HxplckY2jXSwfDRE
volumes:
mongodb_master_data:
driver: local