Skip to content

Instantly share code, notes, and snippets.

@uuhnaut69
Created August 10, 2021 07:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uuhnaut69/e5aae053a319f3f94279f3c93f0dac4a to your computer and use it in GitHub Desktop.
Save uuhnaut69/e5aae053a319f3f94279f3c93f0dac4a to your computer and use it in GitHub Desktop.
version: "3.7"
services:
mongo:
container_name: mongo
image: mongo
volumes:
- ./mongo-init.js:/initiator/mongo-init.js
ports:
- "27017:27017"
entrypoint: [ "/usr/bin/mongod", "--replSet", "rs0", "--bind_ip_all" ]
restart: on-failure
----------------
// Setup replica set
rs.initiate({_id: "rs0", members: [{"_id": 0, "host": "localhost:27017", "priority": 4}]});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment