forked from gimdongwoo/docker-parse-mongo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-init.yml
53 lines (53 loc) · 1.28 KB
/
docker-compose-init.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
version: "2"
services:
mongo3:
container_name: mongo3
image: mongo:3.4
mem_reservation: 64m
ports:
- "27018:27018"
- "28018:28018"
networks:
- my-net
restart: always
volumes:
- ./data/rs0-3:/data/db
entrypoint: [ "mongod", "--replSet", "rs0", "--nojournal", "--smallfiles", "--rest", "--noprealloc", "--port", "27018" ]
mongo2:
container_name: mongo2
image: mongo:3.4
mem_reservation: 256m
ports:
- "27019:27019"
- "28019:28019"
networks:
- my-net
restart: always
volumes:
- ./data/rs0-2:/data/db
entrypoint: [ "mongod", "--replSet", "rs0", "--journal", "--smallfiles", "--rest", "--port", "27019" ]
mongo1:
container_name: mongo1
image: mongo:3.4
mem_reservation: 256m
ports:
- "27017:27017"
- "28017:28017"
networks:
- my-net
restart: always
volumes:
- ./data/rs0-1:/data/db
entrypoint: [ "mongod", "--replSet", "rs0", "--journal", "--smallfiles", "--rest", "--port", "27017" ]
# Configures the MongoDB replicaset
mongosetup:
mem_reservation: 64m
build: ./mongosetup
networks:
- my-net
volumes:
- ./scripts:/scripts
entrypoint: [ "/scripts/setup_init.sh" ]
networks:
my-net:
driver: bridge