Skip to content
Snippets Groups Projects

Resolve "Run the application on Kubernetes locally using “minikube”"

All threads resolved!
6 files
+ 90
85
Compare changes
  • Side-by-side
  • Inline
Files
6
  • - Added Kubernetes deployment specs for `todo-app` and `mongodb`
    - Configured NodePort service for external access
    - Verified application functionality using `minikube service`
    - Enabled persistent storage for MongoDB using PersistentVolumeClaim
    - Removed unused `ingress.yml` file
    - Provided compatibility for ARM64 and Linux environments
+ 0
47
services:
mongodb:
image: mongo:latest
container_name: mongodb
ports:
- "27017:27017"
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_INITDB_ROOT_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD}
- MONGO_INITDB_DATABASE=todo-app
todo-app-1:
build:
context: .
dockerfile: Dockerfile
container_name: todo-app-1
ports:
- "3001:3000"
depends_on:
- mongodb
environment:
- MONGO_URI=${MONGO_URI}
- PORT=3000
todo-app-2:
build:
context: .
dockerfile: Dockerfile
container_name: todo-app-2
ports:
- "3002:3000"
depends_on:
- mongodb
environment:
- MONGO_URI=${MONGO_URI}
nginx:
image: nginx:latest
container_name: nginx
ports:
- "80:80"
depends_on:
- todo-app-1
- todo-app-2
volumes:
- "./nginx.conf:/etc/nginx/nginx.conf:ro"
- "/var/log/nginx/access.log:/var/log/nginx/access.log"
Loading