Deployment¶
Docker Compose¶
The docker-compose.yaml defines the full development stack: application services, databases, monitoring, and reverse proxy.
Environment Files¶
Copy the defaults before first run:
cp envs/default.mongo_db.env envs/mongo_db.env
cp envs/default.redis.env envs/redis.env
cp envs/default.simulator.env envs/simulator.env
cp envs/default.mongo-keyfile envs/mongo-keyfile
Commands¶
# Start everything
docker compose up --build
# Restart after config changes
docker compose down -v && docker compose up -d
# View logs for a specific service
docker compose logs -f order-service
NGINX Proxy Routes¶
Path |
Backend |
|---|---|
|
Frontend (Vite dev server) |
|
Order service |
|
Notifications service (WebSocket) |
|
Grafana |
|
Prometheus (GET-only) |
Kubernetes (Helm)¶
Chart Structure¶
charts/orders-project/ # Umbrella chart
charts/
orders/ # Order service subchart
delivery/ # Delivery service subchart
notifications/ # Notifications service subchart
frontend/ # Frontend subchart
simulator/ # Simulator subchart
mongodb/ # MongoDB StatefulSet
redis/ # Redis StatefulSet
dashboards/ # Grafana dashboard JSONs
templates/
configs.yaml # Shared ConfigMaps
secrets.yaml # Shared Secrets
ingress.yaml # Ingress rules
grafana-dashboards.yaml # Dashboard ConfigMaps
External dependencies (from Chart.yaml):
ingress-nginx4.12.1kube-prometheus-stack69.8.2loki6.28.0promtail6.16.6
Install¶
helm dependency update charts/orders-project
helm install orders charts/orders-project -n prod --create-namespace
Configuration¶
All values are in charts/orders-project/values.yaml:
global:
mongo:
username: root
password: <change-me>
host: mongo-svc
database: food-delivery
redis:
password: <change-me>
host: redis-svc
Init Jobs¶
On first install, three Jobs run automatically:
init-rs-job – initializes MongoDB replica set (
rs0)init-user-job – creates the MongoDB admin user
init-dummy-db-job – loads demo menu data
Ingress Routes¶
Path |
Service |
|---|---|
|
orders-svc:8003 |
|
notifications-svc:8002 |
|
grafana:80 |
|
frontend-svc:80 |
Monitoring in Kubernetes¶
ServiceMonitors are defined for orders, delivery, and notifications services. Grafana dashboards are provisioned via ConfigMaps with the grafana_dashboard: "1" label (auto-discovered by the sidecar).
Loki is configured as an additional Grafana datasource in values.yaml.