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
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
# ...