A complete DevOps CI/CD pipeline project demonstrating automated deployment of a React application to AWS using Jenkins, Docker, and Nginx.
- Architecture Overview
- Tech Stack
- Project Structure
- Features
- Prerequisites
- Quick Start
- Detailed Setup Guide
- Pipeline Stages
- Configuration
- Monitoring & Logging
- Troubleshooting
- Contributing
- License
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CI/CD PIPELINE ARCHITECTURE β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββ ββββββββββββββββ βββββββββββββββ
β GitHub β βββββββΊ β Jenkins β βββββββΊ β AWS ECR β
β Repo β Webhook β Server β Push β Registry β
ββββββββββββ ββββββββββββββββ βββββββββββββββ
β β
β Build β Pull
βΌ βΌ
ββββββββββββββββ βββββββββββββββ
β Docker β β EC2 β
β Image β βββββββΊ β Server β
ββββββββββββββββ Deploy βββββββββββββββ
β
βΌ
βββββββββββββββ
β Nginx β
β + App β
βββββββββββββββ
β
βΌ
βββββββββββββββ
β Users β
βββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β Developer GitHub Jenkins AWS β
β β β β β β
β β Push Code β β β β
β βββββββββββββββββΊβ β β β
β β β Webhook β β β
β β ββββββββββββββββββΊβ β β
β β β β β β
β β β β Docker Build β β
β β β ββββββββββββββββΊβ β
β β β β β β
β β β β Push to ECR β β
β β β ββββββββββββββββΊβ ECR β
β β β β β β
β β β β Deploy β β
β β β ββββββββββββββββΊβ EC2 β
β β β β β β
β β β β Health Check β β
β β β βββββββββββββββββ β
β β β β β β
β β Success! β β β β
β ββββββββββββββββββββββββββββββββββββ β β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Category | Technology |
|---|---|
| CI/CD | Jenkins |
| Containerization | Docker |
| Container Registry | AWS ECR |
| Cloud Platform | AWS (EC2, ECR, IAM) |
| Web Server | Nginx |
| Version Control | Git, GitHub |
| Application | React + TypeScript + Vite |
| Backend Services | Supabase |
resume-builder-devops/
βββ π README.md # This file
βββ π Dockerfile # Multi-stage Docker build
βββ π Jenkinsfile # CI/CD Pipeline definition
βββ π docker-compose.yml # Local development setup
βββ π docker-compose.prod.yml # Production deployment
βββ π .dockerignore # Docker build exclusions
βββ π nginx/
β βββ nginx.conf # Main Nginx configuration
β βββ default.conf # Server block configuration
β βββ proxy.conf # Reverse proxy for production
βββ π scripts/
β βββ setup-jenkins.sh # Jenkins server setup script
β βββ setup-app-server.sh # Application server setup
β βββ deploy.sh # Manual deployment script
βββ π docs/
βββ DEPLOYMENT_GUIDE.md # Detailed deployment guide
βββ TROUBLESHOOTING.md # Common issues and solutions
- β Automated Builds: Triggered on every push to main branch
- β Docker Multi-stage Build: Optimized image size
- β AWS ECR Integration: Secure container registry
- β Automated Deployment: Zero-downtime deployment to EC2
- β Health Checks: Automatic verification after deployment
- β Nginx Reverse Proxy: SSL termination and load balancing
- β Docker Containerization: Consistent environments
- β Environment Variables: Secure secrets management
- β Gzip Compression: Optimized content delivery
- β Security Headers: XSS, CSRF protection
- β Container Health Checks: Built-in Docker health monitoring
- β Nginx Access Logs: Request logging and analysis
- β Jenkins Build History: Pipeline execution tracking
- EC2 instances (2x - Jenkins + App server)
- ECR repository
- IAM roles with appropriate permissions
- Docker Desktop
- Git
- Node.js 20+
- Ubuntu 22.04 LTS
- Java 17+
- Docker
- AWS CLI
git clone https://github.com/yourusername/resume-builder-devops.git
cd resume-builder-devops# Build and run locally
docker-compose up --build
# Access the application
open http://localhost:3000# Deploy with SSL (on EC2)
docker-compose -f docker-compose.prod.yml up -dJenkins Server:
- Instance Type:
t3.smallort3.medium - AMI: Ubuntu 22.04 LTS
- Storage: 20GB
- Security Group Ports: 22, 8080
Application Server:
- Instance Type:
t3.microort3.small - AMI: Ubuntu 22.04 LTS
- Storage: 10GB
- Security Group Ports: 22, 80, 443, 3000
# Create ECR repository
aws ecr create-repository --repository-name resume-builder --region ap-south-1SSH into Jenkins server and run:
#!/bin/bash
# Update system
sudo apt update && sudo apt upgrade -y
# Install Java
sudo apt install -y fontconfig openjdk-17-jdk
# Install Docker
sudo apt install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker
sudo usermod -aG docker ubuntu
# Install Jenkins
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \
https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
echo "deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
https://pkg.jenkins.io/debian-stable binary/" | \
sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt update
sudo apt install -y jenkins
# Add jenkins to docker group
sudo usermod -aG docker jenkins
sudo systemctl restart jenkins
# Install AWS CLI
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
sudo apt install -y unzip
unzip awscliv2.zip
sudo ./aws/install
# Show Jenkins initial password
echo "=== Jenkins Initial Password ==="
sudo cat /var/lib/jenkins/secrets/initialAdminPasswordAdd these credentials in Jenkins (Manage Jenkins β Credentials):
| ID | Type | Description |
|---|---|---|
aws-ecr-registry |
Secret text | ECR registry URL |
vite-openrouter-api-key |
Secret text | OpenRouter API Key |
vite-supabase-url |
Secret text | Supabase URL |
vite-supabase-anon-key |
Secret text | Supabase Anon Key |
ec2-host-ip |
Secret text | App EC2 Public IP |
ec2-ssh-key |
SSH Username with private key | EC2 SSH Key |
github-credentials |
Username with password | GitHub PAT |
- New Item β Pipeline
- Pipeline from SCM β Git
- Repository URL: Your GitHub repo
- Branch:
*/main - Script Path:
Jenkinsfile
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β JENKINS PIPELINE STAGES β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ
β Checkout βββββΊβ Docker βββββΊβ Push to βββββΊβ Deploy β
β Code β β Build β β ECR β β to EC2 β
ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ
β
βΌ
ββββββββββββ
β Health β
β Check β
ββββββββββββ
| Stage | Description | Duration |
|---|---|---|
| Checkout | Clone repository from GitHub | ~5s |
| Docker Build | Multi-stage build with Nginx | ~60s |
| Push to ECR | Tag and push to AWS ECR | ~10s |
| Deploy to EC2 | SSH deploy and restart container | ~15s |
| Health Check | Verify application is running | ~10s |
| Variable | Description |
|---|---|
VITE_OPENROUTER_API_KEY |
OpenRouter API key for AI features |
VITE_SUPABASE_URL |
Supabase project URL |
VITE_SUPABASE_ANON_KEY |
Supabase anonymous key |
The application uses Nginx with:
- Gzip compression enabled
- Static file caching
- SPA routing support
- Security headers
Multi-stage build process:
- Stage 1 (Builder): Node.js builds the React app
- Stage 2 (Production): Nginx serves the built assets
# View application logs
docker logs resume-builder-app
# Follow logs in real-time
docker logs -f resume-builder-app# Access logs
docker exec resume-builder-app cat /var/log/nginx/access.log
# Error logs
docker exec resume-builder-app cat /var/log/nginx/error.log# Check container health
docker inspect --format='{{.State.Health.Status}}' resume-builder-app
# Manual health check
curl http://localhost:3000/health| Issue | Solution |
|---|---|
| Docker permission denied | sudo usermod -aG docker jenkins && sudo systemctl restart jenkins |
| ECR login failed | Configure AWS CLI: aws configure |
| SSH connection timeout | Check security group rules |
| Health check failing | Verify port 3000 is open |
# Check Docker status
sudo systemctl status docker
# Check Jenkins status
sudo systemctl status jenkins
# List running containers
docker ps
# Check container logs
docker logs resume-builder-appJenkins Server and Application Server running on AWS EC2
Complete CI/CD pipeline execution with all stages passed
Docker images stored in Amazon Elastic Container Registry
IAM role with ECR permissions attached to EC2 instances
Live server logs showing application requests
Docker container running with health status showing "healthy"
Real-time resource usage monitoring of the deployed container
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
John Smilin DS
- GitHub: @Smilin01
- LinkedIn: John Smilin
β Star this repository if you found it helpful!







