- index.html with pure js and css styles
- nodejs backend with express module
- mongodb for data storage
To start the application
$ docker network create mongo-network
$ docker run -d -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=password --name mongodb --net mongo-network mongo
$ docker run -d -p 8081:8081 -e ME_CONFIG_MONGODB_ADMINUSERNAME=admin -e ME_CONFIG_MONGODB_ADMINPASSWORD=password --net mongo-network --name mongo-express -e ME_CONFIG_MONGODB_SERVER=mongodb mongo-express
NOTE: creating docker-network in optional. You can start both containers in a default network. In this case, just emit --net flag in docker run command
Link: http://localhost:8081
$ npm install
$ node server.js
Link: http://localhost:3000
Part 2: With Docker Compose: part of Infrastructure as a Code (IaaC), provisioning and running containers over a default network using docker compose file.
$ docker-compose -f docker-compose.yaml up
You can access the mongo-express under localhost:8080 from your browser
$ npm install
$ node server.js
$ docker build -t my-app:1.0 .