This image deploys a mongodb replica set database. Meant for development.
https://github.com/VincentGillot/mongodb-replicaset
This instance deploys on localhost:27017,localhost:27018,localhost:27019
mongodb://{MONGO_CLIENT_USER}:{MONGO_CLIENT_PASSWORD}@localhost:27017,localhost:27018,localhost:27019/{MONGO_CLIENT_DATABASE}?replicaSet=rs0&readPreference=primary&ssl=false&authSource=admin
The database files are saved to the following directories:
- /mongo/data/replica1/data
- /mongo/data/replica2/data
- /mongo/data/replica3/data
volumes:
- ./database:/mongo/data
- KEY_FILE_SECRET=mysecretkey
- MONGO_ROOT_USER=root
- MONGO_ROOT_PASSWORD=root
- MONGO_CLIENT_USER=client
- MONGO_CLIENT_PASSWORD=client
- MONGO_CLIENT_DATABASE=main
This file is created and used for the replicaset keyFile parameter.