This repository contains the configuration and setup for deploying a multi-tier application using Docker and Kubernetes. The project is designed to demonstrate how to build and deploy a scalable, fault-tolerant application architecture using modern containerization and orchestration technologies.
- Description: Serves the user interface for the application.
- Dockerfile: Configures the Docker image for the Nginx web server.
- Configuration: Includes
nginx.confto define server behavior andindex.htmlfor the static content served by Nginx.
- Description: Handles business logic and API requests.
- Dockerfile: Configures the Docker image for the Flask application.
- Requirements:
requirements.txtlists Python dependencies required by the Flask application. - Application:
app.pycontains the Flask application code, implementing the API endpoints.
- Description: Manages data storage for the application.
- Image: Uses the official MySQL image from Docker Hub.
- Configuration: Includes necessary environment variables for initializing the MySQL database.
The docker-compose.yml file defines and runs the multi-container Docker application. It includes:
- Frontend Service: Nginx, serving the static content.
- Backend Service: Flask application, handling API requests.
- Database Service: MySQL, managing the application data.
- Networks: Configures
mynetworkto enable communication between services.
Kubernetes manifests are provided to deploy the application to a Kubernetes cluster. The manifests include:
- Deployments: Define the deployment specifications for frontend, backend, and database services.
- Services: Define how each component is exposed and accessed within the cluster.
- ConfigMaps and Secrets: Manage configuration and sensitive data.
- Ingress: (If used) Provides external access to the frontend service, configured to handle routing and load balancing.
- Auto-Scaling: Configured to scale application components based on demand.
- Load Balancing: Distributes incoming traffic across multiple instances of the services.
- Monitoring: Integrated monitoring for tracking application health and performance.
- Build Docker Images:
docker build -t your-dockerhub-username/frontend:latest . docker build -t your-dockerhub-username/backend:latest .