-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
100 lines (100 loc) · 2.76 KB
/
docker-compose.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
services:
whoosh:
container_name: whoosh
build: .
networks:
- whoosh_network
volumes:
- .:/app
ports:
- "${APP_PORT}:${APP_PORT}"
depends_on:
- mongo1
mongo1:
container_name: mongo1
image: "mongo:7"
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
MONGO_INITDB_DATABASE: ${MONGO_INITDB_DATABASE}
ports:
- "27021:27017"
volumes:
- "mongo-1:/data/db"
- "./mongo.key:/data/mongo.key"
depends_on:
- mongo2
- mongo3
networks:
- whoosh_network
restart: always
command: "mongod --bind_ip_all --replSet dbrs --keyFile /data/mongo.key"
mongo2:
container_name: mongo2
image: "mongo:7"
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
MONGO_INITDB_DATABASE: ${MONGO_INITDB_DATABASE}
ports:
- "27022:27017"
volumes:
- "mongo-2:/data/db"
- "./mongo.key:/data/mongo.key"
networks:
- whoosh_network
restart: always
command: "mongod --bind_ip_all --replSet dbrs --keyFile /data/mongo.key"
mongo3:
container_name: mongo3
image: "mongo:7"
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
MONGO_INITDB_DATABASE: ${MONGO_INITDB_DATABASE}
ports:
- "27023:27017"
volumes:
- "mongo-3:/data/db"
- "./mongo.key:/data/mongo.key"
networks:
- whoosh_network
restart: always
command: "mongod --bind_ip_all --replSet dbrs --keyFile /data/mongo.key"
mongo-setup:
image: "mongo:7"
container_name: mongo-setup
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
MONGO_INITDB_DATABASE: ${MONGO_INITDB_DATABASE}
depends_on:
- mongo1
- mongo2
- mongo3
volumes:
- "./rs-init.sh:/scripts/rs-init.sh"
restart: on-failure
entrypoint: ["/bin/bash", "/scripts/rs-init.sh"]
networks:
- whoosh_network
mongo-express:
container_name: mongo-express
image: mongo-express
restart: always
ports:
- 8081:8081
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_INITDB_ROOT_USERNAME}
ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
ME_CONFIG_MONGODB_URL: "mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@mongo1:27017,mongo2:27017,mongo3:27017/?replicaSet=dbrs"
networks:
- whoosh_network
depends_on:
- "mongo1"
networks:
whoosh_network:
volumes:
mongo-1:
mongo-2:
mongo-3: