https://github.com/dsrathore1/devops-project-1
My application is running successfully inside a Docker container on an AWS EC2 instance, but Iβm unable to access it publicly over the internet. This issue usually arises due to improper port exposure, security group restrictions, or incorrect application binding.
https://github.com/dsrathore1/devops-project-1
devops docker fastapi
Last synced: 2 months ago
JSON representation
My application is running successfully inside a Docker container on an AWS EC2 instance, but Iβm unable to access it publicly over the internet. This issue usually arises due to improper port exposure, security group restrictions, or incorrect application binding.
- Host: GitHub
- URL: https://github.com/dsrathore1/devops-project-1
- Owner: dsrathore1
- Created: 2025-05-20T05:54:24.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-05-21T01:47:20.000Z (11 months ago)
- Last Synced: 2025-08-06T00:51:39.551Z (8 months ago)
- Topics: devops, docker, fastapi
- Language: Python
- Homepage:
- Size: 313 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π CI/CD Pipeline for FastAPI Application Deployment on AWS EC2 Using Docker and GitHub Actions
## π Project Overview
This project demonstrates how to build, containerize, and automatically deploy a **FastAPI web application** using a full CI/CD pipeline. The entire process is automated via **GitHub Actions**, with deployment to an **AWS EC2** instance using **Docker**.
The purpose of this project is to gain hands-on experience with foundational DevOps tools while understanding modern deployment workflows.
---
## π― Objective
- β
Build and containerize a simple FastAPI application
- β
Set up an EC2 server on AWS
- β
Create a GitHub Actions workflow for CI/CD
- β
Automate Docker image build and push to Docker Hub
- β
Deploy container on EC2 using SSH commands in workflow
---
## π§ Technologies Used
| Tool | Purpose |
|---------------|-----------------------------------|
| **FastAPI** | Lightweight Python web framework |
| **Docker** | Containerization of the app |
| **GitHub** | Source code repository |
| **GitHub Actions** | CI/CD automation pipeline |
| **AWS EC2** | Hosting the deployed container |
| **Docker Hub**| Docker image registry |
---
## π§± Features
- π§© FastAPI backend with two endpoints:
- `GET /` β Returns βHello from DevOps Appβ
- `GET /health` β Health check
- π³ Dockerized application
- π CI/CD pipeline on GitHub Actions:
- Builds Docker image
- Pushes image to Docker Hub
- Connects to EC2 and deploys container
- π Secure deployment using GitHub Secrets and SSH keys
---
## πΊοΈ Architecture Diagram