This project demonstrates the development, containerization, orchestration, and deployment of a Python Flask application using Docker, Docker Compose, and Terraform on AWS EC2.
- Python Flask - Web framework
- Docker & Docker Compose - Containerization and service orchestration
- PostgreSQL - Database integration
- Terraform - Infrastructure as Code (IaC) for AWS provisioning
- AWS EC2 - Cloud deployment
- Linux WSL - Local development environment
- Built a scalable Python Flask web application.
- Used multi-stage builds to reduce image size by 30% and improve deployment efficiency.
- Pushed Docker images to Docker Hub and managed containers locally.
- Integrated PostgreSQL for database functionality.
- Configured Docker Compose to deploy the Flask app and PostgreSQL database as interdependent services.
- Reduced setup time by 50% compared to manual configurations.
- Implemented port mapping and environment variable management for seamless local testing.
- Automated the deployment of an AWS EC2 instance to host the Dockerized Flask app.
- Achieved 100% infrastructure-as-code coverage for the project.
- Configured user data scripts to install Docker and run containers automatically.
git clone https://github.com/heyamay/docker-multi-stage-builds.git
cd flask-docker-terraform
docker build -t flask-app .
docker run -p 5000:5000 flask-app
docker-compose up -d
cd terraform
terraform init
terraform apply -auto-approve
✅ Developed and containerized a Python Flask app using Docker & Docker Compose, reducing deployment setup time by 60%. ✅ Automated AWS EC2 provisioning with Terraform (IaC), cutting manual cloud infrastructure setup time by 80%. ✅ Integrated PostgreSQL in a Dockerized environment, using Docker Volumes for data persistence, reducing database downtime by 90%.
- Docker 🐳
- Terraform 🌍
- PostgreSQL 🛢️
- Linux 🐧
- Amazon Web Services (AWS) ☁️
This project is licensed under the MIT License - see the LICENSE file for details.