This project demonstrates a production-style cloud-native deployment pipeline built using modern DevOps principles.
It automates:
- Infrastructure provisioning (Infrastructure as Code)
- Containerized application deployment
- CI/CD pipeline execution
- Reverse proxy configuration
- Secure remote deployment to AWS
The goal is to simulate a real-world enterprise deployment workflow.
graph TD
Developer((fa:fa-code Developer))
GitHub["fa:fa-github GitHub Repository"]
subgraph GH_Actions [GitHub Actions CI/CD]
Build["fa:fa-hammer Build Docker Image"]
DockerPush["fa:fa-docker Push to DockerHub"]
end
DockerHub["fa:fa-box DockerHub Registry"]
subgraph AWS_Cloud [AWS EC2 Infrastructure]
Terraform["fa:fa-cloud Terraform Provisioning"]
subgraph Instance [EC2 Instance]
Nginx["fa:fa-server Nginx Reverse Proxy"]
DockerRun["fa:fa-container Docker Runtime"]
end
end
LiveApp((fa:fa-globe Live Production App))
Developer -- "git push" --> GitHub
GitHub --> Build
Build --> DockerPush
DockerPush -. "kanvit279/devops-app" .-> DockerHub
DockerHub -- "docker pull" --> DockerRun
Terraform -- "IaC" --> AWS_Cloud
Nginx -- "Proxy (80 -> 3000)" --> DockerRun
LiveApp --- Nginx
| βοΈ 3 Cloud Services | ποΈ 3 IaC Components | π³ 3 Container Tools | π 3 CI/CD Stages |
π Click to explore the architecture
π¦ cloud-native-devops-platform
βββ π .github # GitHub Configuration Hub
β βββ π workflows
β βββ π deploy.yml # β‘ CI/CD Automation Engine
β βββ Triggers: push, PR to main
β
βββ π app # π― Application Core
β βββ π index.js # π§ Node.js Core Logic
β β βββ Express server
β β βββ Health endpoints
β β βββ API routes
β βββ π package.json # π¦ Dependency Manifest
β β βββ Scripts
β β βββ Dependencies
β β βββ Metadata
β βββ π Dockerfile # π³ Container Blueprint
β βββ Multi-stage build
β βββ Production optimization
β βββ Security hardening
β
βββ π terraform # ποΈ Infrastructure as Code
β βββ π main.tf # ποΈ Infrastructure Definition
β β βββ EC2 instances
β β βββ Security groups
β β βββ IAM roles
β βββ π variables.tf # βοΈ Environment Variables
β β βββ Instance types
β β βββ Region config
β β βββ Key pairs
β βββ π outputs.tf # π Resource Mapping
β βββ Public IPs
β βββ DNS names
β βββ Instance IDs
β
βββ π nginx # π Reverse Proxy Layer
β βββ π default.conf # π Proxy Rules
β βββ Load balancing
β βββ SSL termination
β βββ Request routing
β
βββ π README.md # π Project Documentation
βββ Setup guide
βββ Deployment steps
βββ API reference
Automated pipeline from development to production
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β π» DEV ββββββΆβ π GITHUB ββββββΆβ π³ DOCKER ββββββΆβ βοΈ AWS β
β PUSH β β ACTIONS β β BUILD β β EC2 β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββ¬ββββββββ
β² β² β² β
βββββββββββββββββββββββββ΄βββββββββββββββββββββββ΄βββββββββββββββββββββββ
π CONTINUOUS DEPLOYMENT PIPELINE
|
1
Code Push0s |
2
CI/CD Trigger5s |
3
Docker Build30s |
4
Push to Hub45s |
5
EC2 Deploy60s |
Automated GitHub Actions workflow for continuous delivery
|
β
Checkout
|
β |
π
Docker Login
|
β |
ποΈ
Build Image
|
β |
π€
Push Image
|
| β | ||||||
|
π
SSH Connect to EC2
β¬οΈ
Pull Image
π
Stop Old
π
Deploy New
|
||||||
|
Eliminates human intervention in deployment process 100% Automated |
Reduces human mistakes in production 99.9% Reliable |
Deploy multiple times per day 2-min cycle |
Version-controlled infrastructure provisioning
|
π Version Control
π Reproducible
π« No Manual Console
β‘ Auto Provision
π No Drift
|
The following Terraform commands are used to manage the infrastructure lifecycle:
# Initialize the working directory
terraform init
# Preview infrastructure changes before applying
terraform plan
# Deploy infrastructure
terraform apply -auto-approve
# Destroy all managed infrastructure
terraform destroy βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AWS Cloud β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Security Group (Ports: 22, 80, 3000) β β
β β βββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β EC2 Instance (t2.micro) β β β
β β β βββββββββββββββββββββββββββββββββββββββ β β β
β β β β Docker Container β β β β
β β β β Node.js App on Port 3000 β β β β
β β β βββββββββββββββββββββββββββββββββββββββ β β β
β β βββββββββββββββββββββββββββββββββββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
1
Write.tf files
|
β |
2
Planterraform plan
|
β |
3
Applyterraform apply
|
β |
4
Manageversion control
|
|
1
Terraform |
β |
2
EC2 Setup |
β |
3
Git Commit |
β |
4
CI/CD |
β |
5
Live App |
ssh-keygen -t rsa -b 4096 -f ~/.ssh/key-name
git clone https://github.com/your-username/cloud-native-devops-platform.git
cd cloud-native-devops-platform# Install AWS CLI and configure:
aws configureβΉοΈ Provide: AWS Access Key, AWS Secret Key, Region (e.g., ap-south-1)
# Navigate to the terraform directory:
cd terraform
terraform init
terraform plan
terraform applyβΉοΈ This creates the EC2 instance and required security groups with ports 22 (SSH), 80 (HTTP), and 3000 (Node.js) open.
# Connect to your EC2 instance
ssh -i your-key-pair.pem ubuntu@<public-ip>
Then install Docker and Nginx:
# Update package lists
sudo apt update && sudo apt upgrade -y
# Install Docker
sudo apt install docker.io -y
sudo systemctl start docker
sudo systemctl enable docker
sudo usermod -aG docker $USER # Add user to docker group
# Install Nginx
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx
# Verify installations
docker --version
nginx -vβΉοΈ EC2 instance is prepared with all necessary tools for containerization and reverse proxy.
Edit Nginx configuration:
sudo nano /etc/nginx/sites-available/default
Replace with:
server {
listen 80;
location / {
proxy_pass http://localhost:3000;
}
}
Restart nginx. Nginx listen on port 80 and forward all incoming web traffic to your application running on port 3000 inside the server.
# Add all changes
git add .
# Commit with a meaningful message
git commit -m "Deploy: Update application with new features"
# Push to main branch (triggers CI/CD)
git push origin main
Before proceeding further, ensure that all required credentials are added under: Repository Settings β Secrets and Variables β Actions.
If it appears like this, it means everything is configured correctly.
Website View
This project can be extended with:
- Auto Scaling Groups for horizontal scaling
- Application Load Balancer for high availability
- HTTPS configuration using SSL certificates
- Blue-Green or Rolling deployments
- Monitoring stack (Prometheus + Grafana)
- Centralized logging
- Kubernetes-based deployment
These enhancements would make the system production-grade at enterprise level.
To avoid unnecessary AWS charges:
terraform destroy- EC2 metrics monitored via CloudWatch
- CPU and memory usage can be tracked
- Docker container status verified using
docker ps - Logs accessible using
docker logs
Monitoring ensures application health and availability.
This project demonstrates a complete DevOps production workflow, including infrastructure provisioning, containerization, CI/CD automation, and secure cloud deployment.
It reflects real-world engineering practices used in modern cloud-native environments.
