https://github.com/mdazfar2/two-tier-flask-app
This project aims to deploy a scalable two-tier application running on Flask and MySQL, designed to handle 10,000 concurrent users while adhering to best DevOps practices. By leveraging Docker, Kubernetes, and AWS services, We ensure fault tolerance, scalability, and efficient deployment.
https://github.com/mdazfar2/two-tier-flask-app
aws-eks docker docker-compose helm kubernetes
Last synced: about 1 month ago
JSON representation
This project aims to deploy a scalable two-tier application running on Flask and MySQL, designed to handle 10,000 concurrent users while adhering to best DevOps practices. By leveraging Docker, Kubernetes, and AWS services, We ensure fault tolerance, scalability, and efficient deployment.
- Host: GitHub
- URL: https://github.com/mdazfar2/two-tier-flask-app
- Owner: mdazfar2
- Created: 2024-03-13T20:16:39.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-22T10:55:38.000Z (about 2 years ago)
- Last Synced: 2025-04-06T00:43:53.441Z (about 1 year ago)
- Topics: aws-eks, docker, docker-compose, helm, kubernetes
- Language: HTML
- Homepage:
- Size: 95.7 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Two Tier Flask App
https://github.com/mdazfar2/two-tier-flask-app/assets/100375390/e54169da-ecba-4ea4-b75b-e75eaca5318a
## Overview-
This project aims to deploy a scalable two-tier application running on Flask and MySQL, designed to handle 10,000 concurrent users while adhering to best DevOps practices. By leveraging Docker, Kubernetes, and AWS services, we ensure fault tolerance, scalability, and efficient deployment.
## Features
- **Scalability**: Designed to handle 10,000 concurrent users.
- **Fault Tolerance**: Utilizes Kubernetes on EKS for fault tolerance.
- **Containerization**: Dockerized application for portability and consistency.
- **Automated Deployment**: Automated Kubernetes cluster setup using HELM.
- **Continuous Integration/Continuous Deployment (CI/CD)**: Implemented DockerHub repository for versioning and continuous deployment.
- **Improved Downtime**: Reduced downtime by 60% with AWS Managed EKS.
# Step by Step guide for making this project-
1. **Execute the commands one by one, this is for Ubuntu**
```bash
sudo apt install
```
```bash
sudo apt update
```
```bash
sudo apt install docker.io
```
```bash
sudo chown $USER /var/run/docker.sock
```
```bash
docker ps
```
2. **Now, execute below commands one by one**
```bash
git clone https://github.com/mdazfar2/two-tier-flask-app.git
```
```bash
cd two-tier-flask-app
```
```bash
docker build . -t flaskapp
```
```bash
docker images
```
```bash
docker network create twotier
```
```bash
docker run -d -p 5000:5000 --network=twotier -e MYSQL_HOST=mysql -e MYSQL_USER=admin -e MYSQL_PASSWORD=admin -e MYSQL_DB=myDB --name=flaskapp flaskapp:latest
```
```bash
docker run -d -p 3306:3306 --network=twotier -e MYSQL_DATABASE=myDB -e MYSQL_USER=admin -e MYSQL_PASSWORD=admin -e MYSQL_ROOT_PASSWORD=admin --name=mysql mysql:5.7
```
3. **Now use the Ip and add the port to :5000**
4. **Then execute the command for MYSQL-**
```bash
docker exec -it 634c54ae7bbb bash
```
> [!NOTE]
> Instead of 634c54ae7bbb use the `container Id` of MYSQL.
```bash
mysql -u root -p
```
> [!NOTE]
> After run the up command then, Put the password `admin`.
```bash
show databases;
```
```bash
use myDB
```
```sql
CREATE TABLE messages (
id INT AUTO_INCREMENT PRIMARY KEY,
message TEXT
```
5. **Show your messages in you MYSQL Database**
```bash
select * from messages;
```
6. **If you want to delete all the history from your database**
```bash
DELETE FROM messages;
```
***This is all that I deployed two tier flask app using dockerising . If you stuck during making this project, feel free to ask anything. I love to help you. You can contact me on [LinkedIn](https://linkedin.com/in/md-azfar-alam), [Instagram](https://www.instagram.com/azfarxx_/) or [Discord](https://discord.com/users/877531143610708028)***
## Keep Learning & Sharing.. ✨