Created
August 13, 2020 21:40
-
-
Save austinmccalley/408bbfea5dcc8bd185f18048a06e50f8 to your computer and use it in GitHub Desktop.
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: '3.3' | |
services: | |
mongo-primary: | |
container_name: mongo-primary | |
image: mongo:4.0.11 | |
volumes: | |
- $HOME/.dockerMongoRepl/primary/data/db:/data/db | |
- $HOME/.dockerMongoRepl/keyfile:/data/keyfile | |
extra_hosts: | |
- 'url:ip' | |
ports: | |
- 27017:27017 | |
restart: always | |
environment: | |
- MONGO_INITDB_ROOT_USERNAME=admin | |
- MONGO_INITDB_ROOT_PASSWORD=admin | |
command: --bind_ip_all --auth --keyFile /data/keyfile/mongo-cluster-key --replSet rs0 | |
mongo-secondary: | |
container_name: mongo-secondary | |
image: mongo:4.0.11 | |
volumes: | |
- $HOME/.dockerMongoRepl/secondary/data/db:/data/db | |
- $HOME/.dockerMongoRepl/keyfile:/data/keyfile | |
depends_on: | |
- mongo-primary | |
extra_hosts: | |
- 'url:ip' | |
ports: | |
- 27018:27017 | |
restart: always | |
command: --bind_ip_all -auth --keyFile /data/keyfile/mongo-cluster-key --replSet rs0 | |
mongo-arbiter: | |
container_name: mongo-arbiter | |
image: mongo:4.0.11 | |
volumes: | |
- $HOME/.dockerMongoRepl/arbiter/data/arb:/data/arb | |
- $HOME/.dockerMongoRepl/keyfile:/data/keyfile | |
depends_on: | |
- mongo-primary | |
extra_hosts: | |
- 'url:ip' | |
ports: | |
- 27019:27017 | |
restart: always | |
command: --bind_ip_all --auth --keyFile /data/keyfile/mongo-cluster-key --replSet rs0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment