Skip to content

Instantly share code, notes, and snippets.

@j-chimienti
Last active February 1, 2019 19:24
Show Gist options
  • Select an option

  • Save j-chimienti/eacb197880ee15e97a7bd8eee8f7129f to your computer and use it in GitHub Desktop.

Select an option

Save j-chimienti/eacb197880ee15e97a7bd8eee8f7129f to your computer and use it in GitHub Desktop.
Mongo cluster
version: '3.1'
services:
mongo1:
hostname: mongo1
container_name: localmongo1
image: mongo
expose:
- 27017
restart: always
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0" ]
mongo2:
hostname: mongo2
container_name: localmongo2
image: mongo
expose:
- 27017
restart: always
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs1" ]
mongo3:
hostname: mongo3
container_name: localmongo3
image: mongo
ports:
- 27017:27017
restart: always
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs2" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment