An open API service indexing awesome lists of open source software.

https://github.com/elijahu1/container-orch

A Dockerized Flask blog app deployed on AWS ECS with CI/CD automation using GitHub Actions and Amazon ECR/EKS.
https://github.com/elijahu1/container-orch

aws blog docker ecs eks flask

Last synced: 4 months ago
JSON representation

A Dockerized Flask blog app deployed on AWS ECS with CI/CD automation using GitHub Actions and Amazon ECR/EKS.

Awesome Lists containing this project

README

          

# CI/CD Flask App Deployment with Docker, AWS, and GitHub Actions

## 🚀 Project Overview

This project demonstrates how to deploy a Flask web application using a modern CI/CD pipeline. The infrastructure leverages Docker for containerization, AWS ECS for container orchestration, and GitHub Actions for automation. This pipeline ensures efficient, scalable, and secure deployment for web apps.

## 🎯 Features
- **Flask**: Lightweight Python web framework.
- **Docker**: Containerized the application for consistent environment.
- **AWS ECS (Fargate)**: Scalable container orchestration with Amazon ECS.
- **GitHub Actions**: CI/CD automation for building, testing, and deploying the app.
- **Secure & Scalable**: Uses IAM roles for secure AWS interactions and scaling through ECS.

## 🛠️ Tools & Technologies
- **Flask**: A micro web framework for Python.
- **Docker**: Containerization platform to package the app.
- **AWS ECS**: Elastic Container Service for deploying containers.
- **AWS ECR**: Elastic Container Registry for storing Docker images.
- **GitHub Actions**: CI/CD automation.
- **Terraform** *(Optional)*: Infrastructure-as-code for AWS resources.

## 📦 Installation

1. Clone the repository:
```bash
git clone https://github.com/yourusername/your-repo-name.git
cd your-repo-name
```

2. Install dependencies for the Flask app:
```bash
pip install -r requirements.txt
```

3. Build the Docker image:
```bash
docker build -t flask-app .
```

4. Run the Flask app locally:
```bash
docker run -p 5000:5000 flask-app
```

5. Follow the steps in the [CI/CD Pipeline section](#cicd-pipeline-setup) to set up the pipeline.

## 📝 CI/CD Pipeline Setup

1. **Dockerize the Flask app**: Create a `Dockerfile` to build the app image.
2. **Push image to AWS ECR**: Use AWS CLI to authenticate and push your image.
3. **Create ECS Task & Service**: Set up ECS task definitions and services for Fargate.
4. **Automate with GitHub Actions**: Create a GitHub Actions workflow for continuous integration and deployment.

For full setup instructions and examples, check out the [blog post](https://elijahu.me/portfolio/cicd-container-orch) and [GitHub Actions Workflow](https://github.com/elijahu1/container-orch/actions) files.

---

## 📖 Contribution

We welcome contributions! If you want to improve this project, feel free to submit a pull request.

### How to Contribute:
1. Fork this repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Make your changes and commit them (`git commit -am 'Add new feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Open a pull request.

---

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

## 🤝 Support

If you need any help or have questions, feel free to reach out to us via [GitHub Issues](https://github.com/elijahu1/container-orch/issues).

---

## 🧑‍💻 Acknowledgments

- Special thanks to the open-source community for providing valuable resources for this project.
- Shoutout to [@mesinkasir](https://github.com/mesinkasir) for the initial template.