This repository contains the deliverables for the Multi-Container Application Deployment task assigned by Techdome. The task involves deploying a full-stack application (frontend, backend, and database) using Docker Compose and Kubernetes. Below, you’ll find the architecture details, deployment strategy, and instructions for building and deploying the application.
This repository contains two key components:
- Backend: Techdome-backend
- Frontend: Techdome-frontend
- Docker: For containerizing the application.
- Docker Compose: To define and manage multi-container applications.
- Kubernetes: For deploying and managing the application in a local Kubernetes cluster.
- Minikube: For setting up a local Kubernetes environment.
The multi-container application consists of the following services:
-
Frontend Container:
- A user-facing web application that communicates with the backend API.
- Built with modern web technologies (e.g., React, Angular, or Vue).
-
Backend Container:
- A RESTful API service that handles business logic and connects to the database.
- Built with a framework like Node.js, Flask, or Django.
-
Database Container:
- A database service to persist application data.
- Uses a relational or NoSQL database like MySQL, PostgreSQL, or MongoDB.
These three containers are interconnected, forming a complete full-stack application.
The Docker Compose file is used to define and manage the application’s containers. It specifies how each container (frontend, backend, and database) is built, networked, and run.
- Services: Defines the frontend, backend, and database containers.
- Networks: Configures container networking to enable inter-service communication.
- Volumes: Configures persistent storage for the database container.
- Ports: Maps the internal container ports to the host machine for accessibility.
- Clone the repositories:
git clone https://github.com/Anand-1432/Techdome-backend git clone https://github.com/Anand-1432/Techdome-frontend
- Run Docker Compose:
docker-compose up --build
- Access the frontend application in the browser at
http://localhost:<frontend_port>
.
The application is deployed on a local Kubernetes cluster (using Minikube) for container orchestration. The deployment involves creating Pods, Services, and Deployments for the frontend, backend, and database components.
- Deployment Manifests: YAML files that define the deployment of each container as a Pod.
- Service Manifests: YAML files that define how services within the Kubernetes cluster communicate.
- Start Minikube:
minikube start
- Apply the Kubernetes manifests:
kubectl apply -f kubernetes-manifests/
- Verify the Pods and Services are running:
kubectl get pods kubectl get services
- Access the frontend application via the Minikube service IP:
minikube service <frontend-service-name>
- Local Development: For local development and testing, Docker Compose is used to spin up all the containers and connect them via a shared network.
- Kubernetes Deployment: Once the application is tested locally, it is deployed to a local Kubernetes cluster using Minikube. Kubernetes handles the orchestration, load balancing, and scaling of the containers.
- Networking: The frontend and backend communicate via a private Docker/Kubernetes network. The database container is also reachable from the backend container.
- Docker Compose File: Defines the multi-container architecture.
- Kubernetes Deployment Manifests: (Optional) YAML files for deploying the application in Kubernetes.
- Documentation: This README file provides an overview of the application architecture and the deployment process.
This multi-container application successfully demonstrates deploying a full-stack system using Docker Compose and Kubernetes. The setup ensures scalability, modularity, and easy orchestration of the application services.