https://github.com/omjaju18/3-tier-application-docker
Three-tier Application
https://github.com/omjaju18/3-tier-application-docker
docker docker-compose docker-container docker-image dockerfile github jenkins jenkins-pipeline jenkins-plugin jenkinsfile
Last synced: 2 months ago
JSON representation
Three-tier Application
- Host: GitHub
- URL: https://github.com/omjaju18/3-tier-application-docker
- Owner: omjaju18
- Created: 2025-01-10T16:47:30.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-22T06:34:56.000Z (over 1 year ago)
- Last Synced: 2025-02-22T07:24:55.746Z (over 1 year ago)
- Topics: docker, docker-compose, docker-container, docker-image, dockerfile, github, jenkins, jenkins-pipeline, jenkins-plugin, jenkinsfile
- Language: JavaScript
- Homepage:
- Size: 87.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A simple MERN stack application
### Create a network for the docker containers
`docker network create demo`
### Build the client
```sh
cd mern/frontend
docker build -t mern-frontend .
```
### Run the client
`docker run --name=frontend --network=demo -d -p 5173:5173 mern-frontend`
### Verify the client is running
Open your browser and type `http://localhost:5173`
### Run the mongodb container
`docker run --network=demo --name mongodb -d -p 27017:27017 -v ~/opt/data:/data/db mongodb:latest`
### Build the server
```sh
cd mern/backend
docker build -t mern-backend .
```
### Run the server
`docker run --name=backend --network=demo -d -p 5050:5050 mern-backend`
## Using Docker Compose
`docker compose up -d`
## Outputs




## Explanation of Porject
### **Project: Three-Tier Web Application Using Docker**
- Built a **three-tier architecture** with **React (frontend), Express.js (backend), and MongoDB (database)**.
- **Containerized** each component using **Dockerfiles** and managed them with **Docker Compose**.
- Created a **Docker network** for **secure communication** between containers.
- Ensured **MongoDB data persistence** using **Docker volumes**.
- Used **Docker Compose** to automate deployment and container orchestration.
- Overcame **networking issues** by using **service names instead of localhost**.