Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: '3'
- services:
- mongo1:
- hostname: mongo1
- container_name: localmongo1
- image: mongo
- expose:
- - 27017
- ports:
- - 27017:27017
- restart: always
- entrypoint: ["/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0"]
- # volumes:
- # - /data/db/mongotest:/data/db # This is where your volume will persist. e.g. VOLUME-DIR = ./volumes/mongodb
- mongo2:
- hostname: mongo2
- container_name: localmongo2
- image: mongo
- expose:
- - 27017
- ports:
- - 27018:27017
- restart: always
- entrypoint: ["/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0"]
- mongo3:
- hostname: mongo3
- container_name: localmongo3
- image: mongo
- expose:
- - 27017
- ports:
- - 27019:27017
- restart: always
- entrypoint: ["/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0"]
- rsinit:
- build:
- context: .
- dockerfile: rsinit
- depends_on:
- - mongo1
- - mongo2
- - mongo3
- entrypoint: ["sh", "-c", "rs.sh"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement