Add consistency to mongodb connection string.
In the installation process, it is up to the end-user to go into the server.js and manually change the following lines.
//mongoose.connect('mongodb://127.0.0.1:27017/Orders', { useNewUrlParser: true}); //Use with Node
mongoose.connect('mongodb://'.concat(mongoPort).concat(':27017/Orders'), { useNewUrlParser: true}); //Use with Docker
The former for Node and the latter for Docker. This is not ideal and could lead to problems if we eventually host our Docker images on Dockerhub or AWS ECS. If that was the case, then the user wouldn't be able to change the source code. Frankly, the end-user shouldn't have to see the source code and therefore shouldn't have to change anything.
Thankfully this is an easy fix.
You can specify env variables in docker environment just like you can specify them in regular environments. So you can change the server.js to use environment variables instead of local variables.
For example
const port = process.env.PORT
const mongoPort = process.env.MONGOPORT
Edited by Andrew Cohen