This project demonstrates the complete DevOps workflow for containerizing, deploying, and automating a MEAN Stack CRUD Application using:
- Docker (frontend + backend + MongoDB + Nginx)
- Docker Hub (image registry)
- AWS EC2 (Ubuntu) (production server)
- Docker Compose (multi-service deployment)
- GitHub Actions (CI/CD pipeline)
- Nginx Reverse Proxy (serves frontend + proxies backend API)
The application is fully deployed and accessible at: 👉 http://13.203.213.222/
crud-dd-task-mean-app/
├── backend/
├── frontend/
├── nginx.conf
├── docker-compose.yml
└── .github/workflows/build-and-deploy.yml
- Angular app
- Built and served via Nginx
- Exposed on port 80 inside container
- Node.js + Express API
- MongoDB connection via:
mongodb://mongo:27017/mydb - Runs on port 8080 inside container → exposed as 3000
- Official
mongo:6Docker image - Persistent volume enabled
server {
listen 80;
location /api/ {
proxy_pass http://backend:8080/;
}
location / {
proxy_pass http://frontend:80/;
}
}Runs all services together:
docker-compose up -d
docker-compose down-
Created Ubuntu EC2 instance (t2.micro, free-tier)
-
Installed:
sudo apt update -y sudo apt install docker.io -y sudo apt install docker-compose -y
-
Uploaded
docker-compose.yml&nginx.confusing GitHub Actions -
Launched containers on EC2:
cd ~/app docker-compose up -d
Frontend: http://13.203.213.222/
Automation includes:
- Build Docker images (frontend & backend)
- Push to Docker Hub
- SCP updated config files to EC2
- SSH into EC2 & deploy application
.github/workflows/build-and-deploy.yml
Secrets used:
| Secret Name | Purpose |
|---|---|
DOCKERHUB_USERNAME |
Docker Hub username |
DOCKERHUB_PASSWORD |
Docker Hub token/password |
EC2_HOST |
Public IP of EC2 |
EC2_SSH_KEY |
Private key of EC2 instance |
You MUST include these in your repository README or submission form:
- Backend image
- Frontend image
docker ps output showing 4 containers running:

- mongo
- backend
- frontend
- nginx
Run:
curl http://localhost:3000/api/tutorials- Successful workflow run
- Green check ✔
nginx.conf
curl http://EC2_PUBLIC_IP/api/tutorialsOpen browser →
http://EC2_PUBLIC_IP/
Submit GitHub Repo URL with:
- Complete project folder
- Dockerfiles
- docker-compose.yml
- nginx.conf
- CI/CD workflow file
- README with screenshots



