Skip to content

Instantly share code, notes, and snippets.

@thomasxd24
Last active June 2, 2020 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasxd24/83fe2a33f5567ebf4186bb79d940ec83 to your computer and use it in GitHub Desktop.
Save thomasxd24/83fe2a33f5567ebf4186bb79d940ec83 to your computer and use it in GitHub Desktop.
version: "3"
services:
mongo1:
image: mongo:4.2
command: mongod --replSet rs1 --noauth --oplogSize 3
ports:
- 27017:27017
environment:
TERM: xterm
volumes:
- /etc/localtime:/etc/localtime:ro
- mongo-data-1:/data/db
- mongo-config-1:/data/configdb
networks:
- mongo
deploy:
replicas: 1
placement:
constraints:
- node.labels.mongo.replica == 1
mongo2:
image: mongo:4.2
command: mongod --replSet rs1 --noauth --oplogSize 3
ports:
- 27017:27017
environment:
TERM: xterm
volumes:
- /etc/localtime:/etc/localtime:ro
- mongo-data-2:/data/db
- mongo-config-2:/data/configdb
networks:
- mongo
deploy:
replicas: 1
placement:
constraints:
- node.labels.mongo.replica == 2
mongo3:
image: mongo:4.2
command: mongod --replSet rs1 --noauth --oplogSize 3
ports:
- 27017:27017
environment:
TERM: xterm
volumes:
- /etc/localtime:/etc/localtime:ro
- mongo-data-3:/data/db
- mongo-config-3:/data/configdb
networks:
- mongo
deploy:
replicas: 1
placement:
constraints:
- node.labels.mongo.replica == 3
networks:
mongo:
volumes:
mongo-data-1:
mongo-data-2:
mongo-data-3:
mongo-config-1:
mongo-config-2:
mongo-config-3:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment