Lb1/docs/DEPLOYMENT.md

56 lines
1.3 KiB
Markdown

# 🚀 Luxe Platform - Production Deployment Guide
This guide covers deployment procedures for local Docker Compose development, production Kubernetes environments, and database migrations.
---
## 1. Quick Local Setup with Docker Compose
### Prerequisites
- Node.js >= 22.0.0 LTS
- Docker & Docker Compose
### Step 1: Clone & Configure Environment
```bash
cp .env.example .env
```
### Step 2: Spin Up Infrastructure Containers
```bash
npm run docker:up
```
This launches:
- **PostgreSQL 16**: `localhost:5432`
- **Redis 7**: `localhost:6379`
- **MinIO S3**: `http://localhost:9000` (Console: `http://localhost:9001`)
- **Mailpit SMTP**: `http://localhost:8025`
- **Prometheus**: `http://localhost:9090`
- **Grafana**: `http://localhost:3001`
### Step 3: Run Database Migrations & Seeding
```bash
npm run db:push
npm run db:seed
```
### Step 4: Launch Gateway & Workers in Dev Mode
```bash
npm run dev
```
Open [http://localhost:3000/documentation](http://localhost:3000/documentation) to view the live OpenAPI Swagger UI.
---
## 2. Production Deployment on Kubernetes
### Step 1: Apply Kubernetes Manifests
```bash
kubectl apply -f k8s/deployment.yaml
```
### Step 2: Verify Autoscaling (HPA)
```bash
kubectl get hpa luxe-gateway-hpa
```
The Gateway will automatically scale up to **20 replicas** when CPU utilization exceeds 75%.