This project demonstrates the implementation of a Continuous Integration and Continuous Deployment (CI/CD) pipeline using a combination of GitHub, Jenkins, Docker, AWS EC2, and AWS ECR. The pipeline automates the process of taking a Flask application from a GitHub repository, building a Docker image, running tests, deploying the image to AWS ECR, and then deploying the application on another AWS EC2 instance with nginx as a reverse proxy.
The CI/CD pipeline consists of the following stages:
-
GitHub Webhook Trigger: When changes are pushed to the GitHub repository, the GitHub webhook triggers the Jenkins job.
-
Jenkins Build: Jenkins pulls the code, builds a Docker image, and runs unit tests.
-
AWS ECR Push: The Docker image is pushed to AWS Elastic Container Registry (ECR).
-
SSH into Deployment EC2: Jenkins logs into another AWS EC2 instance via SSH.
-
AWS ECR Pull: The deployment EC2 instance pulls the Docker image from ECR.
-
Docker Container Deployment: The Docker container is started and served via nginx.
