Reminder App - A Two - Tier Node Application (V-1)
Containerization of a Two-Tier Application using Docker
The Reminder Application allows users to add and remove reminders from the frontend.
MongoDB is utilized as the database to store reminder data.
Mongo Express serves as a user interface for MongoDB, facilitating easier database management.
Node.js serves as the middleware layer, responsible for handling business logic, database connections, and data retrieval.
All containers within the application use a common bridge network to facilitate communication.
This description highlights the key components of the Reminder Application architecture, including its frontend, backend, database, and container networking setup.
Concepts:
Networks: Facilitate communication between containers.
Volumes: Enable persistent storage for data, surviving container destruction and recreation.
Docker Compose: Defines and manages multi-container Docker applications using a YAML file, simplifying setup and management tasks.
What will do
This application divided into two parts :
FrontEnd :
UI : Add and Remove Reminder
Middlerware : Nodejs for Business Logic i.e Add, List, Delete etc.
BackEnd :
Mongo DB : NoSQL DB , Use for data storage
Mongo-Express : UI for MongoDB interaction
Steps :
Pull Mongo db and Mongo Express image from Docker Hub
docker pull mongo and mongo-express
Create a Docker file of JS Application and build the file to create image
docker build -t reminder-multi-stage:v1.0 . --no-cache
Create a Compose file [compose.yml]
Service : Web Mongo DB Mongo Express
Volume : Persistent Data store for future reference
Network : Declare a Network , container can communicate with the common network [ or container can use/create default network]
docker-compose -f reminder.yml up -d [detach mode]
docker-compose -f reminder.yml down [remove containers]