These scripts show show to use docker and setup mongodb as a replica set.You can more add more replica sets as your need arises.
Nginx is also used as a reverse proxy and load balance for a sample backend application written in node.js
We have 3 databases.
All these databases can only be accesed by authenticated accounts. The authenticated account(s) is created on the primary database.
Members in the replica set communicate through a trusted key. Key File
You can modify the docker-compose-scripts/mongo/scripts/setup.sh file to suit your needs.
- Primary db
- 2 Secondary dbs
Edit the file ./docker-compose-scripts/nginx/nginx.conf and set your domain name. NOTE:- replace 2246-102-219-249-59.ngrok.io with your domain name
Also change check docker-compose.yml to edit the hostname thus requiring you to edit the same in ./docker-compose-scripts/nginx/nginx.conf
You can then hit the following address for backend without nginx Backend
Backend with nginx Backend NOTE:- replace 2246-102-219-249-59.ngrok.io with your domain name