Created
February 18, 2016 07:22
-
-
Save jmlrt/7f50cdd5464485f65e9b to your computer and use it in GitHub Desktop.
MongoDB Replica Set with Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
mongo1: | |
container_name: mongo1 | |
image: mongo:2.4 | |
expose: | |
- 27017 | |
networks: | |
- mongo | |
command: mongod --replSet rs0 --smallfiles --oplogSize 128 | |
mongo2: | |
container_name: mongo2 | |
image: mongo:2.4 | |
expose: | |
- 27017 | |
networks: | |
- mongo | |
command: mongod --replSet rs0 --smallfiles --oplogSize 128 | |
mongo3: | |
container_name: mongo3 | |
image: mongo:2.4 | |
expose: | |
- 27017 | |
networks: | |
- mongo | |
command: mongod --replSet rs0 --smallfiles --oplogSize 128 | |
networks: | |
mongo: | |
driver: bridge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Commands to run to initiate RS: