Containerizing & Orchestrating a Full-Stack E-commerce Platform with Docker and Kubernetes
Jenkins
Source: Dev.to | Jan 10, 2026 (UTC)
The diagram below provides a visual representation of the services used in this setup to deploy the EasyShop application. This project is hosted on a local Virtual machine, which serves as the base infrastructure. We utilize Docker to build application images and to run Kind (Kubernetes in Docker), which creates a lightweight Kubernetes cluster within the Local VM.
The application images are stored in Docker Hub. Within the Kind cluster, external traffic is managed by the NGINX Ingress Controller, which routes requests to the EasyShop application pods. The application then connects to a MongoDB StatefulSet for data persistence.
What Do We Need?
Local VM (Ubuntu x64): A virtual machine running Ubuntu x64 acts as the primary infrastructure. It serves as the host for deploying the cluster and running all necessary Docker commands.
Git & GitHub: Git is used for version control to manage the codebase locally, while GitHub serves as the remote repository to host the source code of the EasyShop application.
Docker: Used to containerize the application by building Docker Images from the Dockerfile. It is also required to run the Kind nodes, which operate as Docker containers.
Docker Hub: The container registry used to store and share the built images (Application and Migration images), making them accessible to the cluster.
Kind (Kubernetes in Docker): A tool for running local Kubernetes clusters using Docker container “nodes”. It simulates the production environment inside your local VM.
Prerequisites Installation:
Linux:
Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh rm get-docker.sh
Create kubernetes/04-configmap.yaml with the following content:
apiVersion: v1 kind: ConfigMap metadata: name: easyshop-config namespace: easyshop data: MONGODB_URI: "mongodb://mongodb-service:27017/easyshop" NODE_ENV: "production" NEXT_PUBLIC_API_URL: "http://easyshop.local/api" # Add custom local domain or EC2 ip NEXTAUTH_URL: "http://easyshop.local" # Add custom local domain or EC2 ip NEXTAUTH_SECRET: "Generate your own NEXTAUTH secret" JWT_SECRET: "Generate your own JWT secret"
Enter fullscreen mode
Exit fullscreen mode
ADD CUSTOM DOMAIN IF ON LOCAL VM
vim /etc/hosts
Enter fullscreen mode
Exit fullscreen mode
Add this line at the bottom in the file
127.0.0.1 easyshop.local
Enter fullscreen mode
Exit fullscreen mode
Verify :
ping easyshop.local
Enter fullscreen mode
Exit fullscreen mode
To generate secure secret keys, use these commands in your terminal:
# For NEXTAUTH_SECRET openssl rand -base64 32 # For JWT_SECRET openssl rand -hex 32
Залишити відповідь