Skip to content

Instantly share code, notes, and snippets.

@asoorm
Created September 14, 2018 19:00
Show Gist options
  • Save asoorm/7822cc742831639c93affd734e97ce4f to your computer and use it in GitHub Desktop.
Save asoorm/7822cc742831639c93affd734e97ce4f to your computer and use it in GitHub Desktop.

Revisions

  1. asoorm created this gist Sep 14, 2018.
    32 changes: 32 additions & 0 deletions docker-compose-mongo-replicaset.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    version: "3"
    services:
    mongo1:
    hostname: mongo1
    container_name: localmongo1
    image: mongo:4.0-xenial
    expose:
    - 27017
    ports:
    - 27011:27017
    restart: always
    entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0" ]
    mongo2:
    hostname: mongo2
    container_name: localmongo2
    image: mongo:4.0-xenial
    expose:
    - 27017
    ports:
    - 27012:27017
    restart: always
    entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0" ]
    mongo3:
    hostname: mongo3
    container_name: localmongo3
    image: mongo:4.0-xenial
    expose:
    - 27017
    ports:
    - 27013:27017
    restart: always
    entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0" ]