An example on how to use Node.js with Typescript and InversifyJS as IoC container
npm run build && npm run test
docker build --rm -t node-step-by-step .
cd ./nginx-ha
docker build --rm -t node-ha .
docker network create netha
docker run --name=mongo -d --net=netha mongo
In case of CMD npm run serve
in Dockerfile
docker run --name=node1 --env NODE_ENV=production --env MONGO_CONNECTION_STRING=mongodb://mongo:27017/node_step_by_step -d --net=netha node-step-by-step
docker run --name=node2 --env NODE_ENV=production --env MONGO_CONNECTION_STRING=mongodb://mongo:27017/node_step_by_step -d --net=netha node-step-by-step
docker run --name=node3 --env NODE_ENV=production --env MONGO_CONNECTION_STRING=mongodb://mongo:27017/node_step_by_step -d --net=netha node-step-by-step
In case of CMD npm run serve:pm2-runtime
in Dockerfile
docker run --name=node1 -d --net=netha node-step-by-step
docker run --name=node2 -d --net=netha node-step-by-step
docker run --name=node3 -d --net=netha node-step-by-step
docker run --name=node-ha -d --net=netha -p 80:80 node-ha