Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaviara-14/dockerize-a-three-tier-mern-stack-application
Dockerize a Three Tier MERN Stack Application using Docker Compose
https://github.com/kaviara-14/dockerize-a-three-tier-mern-stack-application
docker docker-compose three-tier-architecture
Last synced: 16 days ago
JSON representation
Dockerize a Three Tier MERN Stack Application using Docker Compose
- Host: GitHub
- URL: https://github.com/kaviara-14/dockerize-a-three-tier-mern-stack-application
- Owner: kaviara-14
- Created: 2024-09-11T01:38:33.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-11T02:34:54.000Z (2 months ago)
- Last Synced: 2024-10-10T16:22:26.917Z (about 1 month ago)
- Topics: docker, docker-compose, three-tier-architecture
- Language: JavaScript
- Homepage:
- Size: 181 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dockerize a Three Tier MERN Stack Application
This project demonstrates how to containerize a full Three-Tier MERN (MongoDB, Express, React, Node.js) stack application using Docker Compose.Docker Compose is a tool for defining and running multi-container Docker applications. The setup includes three primary services (Docker Images).
**Frontend:** A React.js application running in a development environment. It listens on port 3000 and automatically reloads changes thanks to volume mounting. It is connected to the backend via the react-express network.
**Backend:** An Express.js server configured for development. It communicates with both the frontend and the MongoDB service through custom bridge networks (react-express and express-mongo). It is also set up to handle dependencies on MongoDB.
**MongoDB:** A MongoDB instance running version 4.2.0, with data persisted using Docker volumes. This service is crucial for storing the application's data and is connected through the express-mongo network.
## Commands to Run :
1.Build and run the application
docker compose up -d2.Listing containers must show containers running and the port mapping as below
![image](https://github.com/user-attachments/assets/20c57aff-d84b-445c-88a9-e74692865118)
3.Access the Application
http://localhost:3000/
4.Stop and Remove Container
docker-compose down
## Expected Result :
![image](https://github.com/user-attachments/assets/7703a5e0-e26e-4fae-bd4b-252e7b3274aa)