Skip to content

cperezabo/mongors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MongoDB with replica set

Docker image based on official MongoDB image with a ready replica set for testing purposes.

Many, I mean, MANY improvements can be done to this, but at the moment it covers my needs

Any idea is welcome

Usage

Build the image with the MongoDB version you need

docker build . --build-arg VERSION=4.4 --tag mongors

Run the image as normal, add the ?replicaSet=rs0 param to the connection url and pray 🙏! 🤣

If you are working with docker-compose, set the PRIMARY_HOST environment variable to match your service name as follow

# ...
services:
  db:
    image: mongors
    env:
      PRIMARY_HOST: db
# ...

About

Docker MongoDB replica set

Resources

Stars

Watchers

Forks

Packages

No packages published