Skip to content

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.

Notifications You must be signed in to change notification settings

mdazfar2/two-tier-flask-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Two Tier Flask App

tutorial.mp4

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

    sudo apt install
    sudo apt update
    sudo apt install docker.io
    sudo chown $USER /var/run/docker.sock
    docker ps
  2. Now, execute below commands one by one

    git clone https://github.com/mdazfar2/two-tier-flask-app.git
    cd two-tier-flask-app
    docker build . -t flaskapp
    docker images
    docker network create twotier
    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
    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-

    docker exec -it 634c54ae7bbb bash

Note

Instead of 634c54ae7bbb use the container Id of MYSQL.

mysql -u root -p

Note

After run the up command then, Put the password admin.

show databases;
use myDB
CREATE TABLE messages (
       id INT AUTO_INCREMENT PRIMARY KEY,
       message TEXT
  1. Show your messages in you MYSQL Database

    select * from messages;
  2. If you want to delete all the history from your database

    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, Instagram or Discord

Keep Learning & Sharing.. ✨

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published