2015-07-30 14:54:22 +08:00
|
|
|
# This will boot 4 containers: 3 mongo as a cluster, and 1 to issue mongo commands to others
|
|
|
|
#
|
2018-03-27 09:26:21 +08:00
|
|
|
version: "2.2"
|
|
|
|
services:
|
|
|
|
mongo3:
|
|
|
|
image: mongo:3.2
|
|
|
|
restart: always
|
|
|
|
entrypoint: [ "/usr/bin/mongod", "--replSet", "rs", "--rest", "--httpinterface" ]
|
2015-07-30 14:54:22 +08:00
|
|
|
|
2018-03-27 09:26:21 +08:00
|
|
|
mongo2:
|
|
|
|
image: mongo:3.2
|
|
|
|
restart: always
|
|
|
|
entrypoint: [ "/usr/bin/mongod", "--replSet", "rs", "--rest", "--httpinterface" ]
|
2015-07-30 14:54:22 +08:00
|
|
|
|
2018-03-27 09:26:21 +08:00
|
|
|
mongo1:
|
|
|
|
image: mongo:3.0
|
|
|
|
restart: always
|
|
|
|
entrypoint: [ "/usr/bin/mongod", "--replSet", "rs", "--rest", "--httpinterface" ]
|
2015-07-30 14:54:22 +08:00
|
|
|
|
2018-03-27 09:26:21 +08:00
|
|
|
mongosetup:
|
|
|
|
image: mongo:3.0
|
|
|
|
volumes:
|
|
|
|
- ./scripts:/scripts
|
|
|
|
restart: always
|
|
|
|
entrypoint: [ "bash", "/scripts/mongosetup.sh" ]
|