This project demonstrates practical DevOps implementation including structured Git workflow, CI/CD automation, Docker-based deployment, environment separation, monitoring strategy and production debugging approach.
- FastAPI (Python)
- Docker (Containerization)
- GitHub Actions (CI/CD)
- Azure Virtual Machine (Cloud Deployment)
- Nginx (Reverse Proxy)
- Git Branching Strategy (Feature → Develop → Main)
This repository follows a structured Git branching model:
main→ Production environmentdevelop→ Staging / integration environmentfeature/*→ Feature development branches
- Feature branch is created from
develop - Pull Request is raised to
develop - CI pipeline validates build & container health
- Feature is merged into
develop(staging deploy triggered) - Release PR is created from
developtomain - Merge to
maintriggers production deployment
Branch protection practices:
- No direct push to
main - CI must pass before merge
- PR review required
CI/CD is implemented using GitHub Actions.
- Dependency installation
- Syntax validation
- Docker image build verification
- Container health endpoint validation
developbranch → Deploys staging containermainbranch → Deploys production container- Deployment happens via secure SSH automation into Azure VM
- Containers are rebuilt and restarted on each deployment
Application is deployed on a single Azure VM using Docker containers.
- Production container runs on port 8000
- Staging container runs on port 8001
- Nginx reverse proxy routes external traffic
- CI pipeline performs automated remote deployment
- Staging →
http://20.244.44.228/staging/health - Production →
http://20.244.44.228/prod/health
- SSH credentials stored in GitHub Secrets
- Environment variables passed during container runtime
- Azure Key Vault recommended for production scale deployments
- Revert to previous Git commit
- Redeploy previous Docker image tag
- Restart container with last stable version
- Re-run CI/CD workflow
- Container logs monitored using
docker logs - Nginx access logs help identify traffic patterns
- Azure Monitor can track CPU / memory utilization
- Health endpoint alerts can detect service failure
- Horizontal container scaling can be implemented for load handling
If production deployment fails:
- Identify blast radius (staging vs production impact)
- Check GitHub Actions logs
- SSH into Azure VM
- Validate container status and logs
- Verify environment configuration
- Rollback to last stable release
- Redeploy and monitor
The application is fully containerized using Docker with a production-ready image design:
- Dockerized application deployment
- Environment separation using container ports
- Reverse proxy routing via Nginx
- Cloud VM deployment on Azure
- CI validated container health checks
- Uses slim Python base image for reduced size
- Runs as non-root user for better security
- Includes container healthcheck endpoint
- Supports environment-based deployments
- Enables reproducible builds across environments
For large-scale production deployment, this architecture can be migrated to Kubernetes:
- Docker image can be deployed using Kubernetes Deployment resource
- Service object can expose application internally
- Ingress controller can replace Nginx reverse proxy
- Horizontal Pod Autoscaler can scale pods based on CPU / memory usage
- ConfigMaps and Secrets can manage runtime configuration
- Rolling updates can ensure zero downtime deployments
Although this implementation uses Azure VM for deployment, similar architecture can be implemented on AWS using:
- EC2 instances for container hosting
- Application Load Balancer for routing
- CloudWatch for logs and metrics
- Auto Scaling Groups for infrastructure scaling
- ECS or EKS for container orchestration