This project is a simple Flask web application that serves two endpoints:
/- Returns "Hello World"/hostname- Returns the hostname of the container running the app.
The application is containerized using Docker, deployed on AWS EC2, and automated via a CI/CD pipeline using GitHub Actions, Terraform, and Ansible.
- REST API with Flask
- Dockerized for easy deployment
- CI/CD pipeline for continuous integration and deployment
- AWS infrastructure provisioning with Terraform
- Automated deployment using Ansible
- Docker installed locally
- An AWS account with permissions to create EC2 instances
- Terraform and Ansible installed
Clone the repository to your local machine:
git clone https://github.com/DimitarDTsonev/DevOps_Project.git
cd ./DevOps_ProjectBuild the Docker image:
bash docker build -t flask-app .
Run the countainer
docker run -d -p 80:80 flask-app
Access the app: Local: http://10.108.6.138:80 Deployed (AWS): Use the public IP of the EC2 instance.
This project uses GitHub Actions for automation:
Build and Push: Automatically builds and pushes the Docker image to GitHub Container Registry (GHCR). Terraform Deployment: Provisions AWS infrastructure (EC2 instance and security group). Ansible Deployment: Configures the EC2 instance to install Docker and deploy the application. Execute the Deployed App Click the link below to access the deployed application: Deployed App on AWS
Replace with the public IP of your deployed AWS EC2 instance. This IP is output by Terraform during the deployment process.
Flask: Web framework for the application Docker: Containerization GitHub Actions: CI/CD automation Terraform: Infrastructure as Code for AWS Ansible: Deployment automation
Dimitar Tsonev
Add unit tests for the Flask application. Implement HTTPS for the deployed application. Deploy using an AWS Elastic Load Balancer (ELB) for scalability. Use AWS Secrets Manager to securely store sensitive information.