This guide provides step-by-step instructions for deploying MLCopilot to production environments using Docker Compose, container registries, or Kubernetes.
- CPU: 4 cores minimum (8 cores recommended for local Ollama inference)
- RAM: 16 GB minimum (32 GB recommended if running
llama3.1:8blocally) - Disk: 50 GB NVMe/SSD storage for database, vector indexes, and object storage
- Docker Engine: v24.0+
- Docker Compose: v2.20+
- Ollama: v0.3.0+ (Installed locally or on an inference server)
-
Clone the Repository:
git clone https://github.com/your-org/MLCopilot-Platform.git cd MLCopilot-Platform -
Setup Production Environment Variables: Copy the example production environment file:
cp production.env.example .env
-
Generate Secure Secrets: Generate a 64-character JWT secret key:
openssl rand -hex 32
Update
JWT_SECRETandPOSTGRES_PASSWORDin.env.
Run the entire platform stack in production mode:
docker compose -f docker-compose.yml up -d --buildweb: Next.js Frontend (Port3000)api: FastAPI Backend (Port8000)postgres: PostgreSQL 16 +pgvectorextension (Port5432)redis: Redis 7 Cache & Task Broker (Port6379)minio: Object Storage for document uploads (Ports9000,9001)
Verify that all service health checks pass:
-
Liveness Probe:
curl -s http://localhost:8000/api/v1/health/live
Expected Output:
{"status":"ok"} -
Readiness Probe:
curl -s http://localhost:8000/api/v1/health/ready
Expected Output:
{"status":"ok","checks":{"database":"ok","redis":"ok","storage":"ok"}} -
LLM Provider Probe:
curl -s http://localhost:8000/api/v1/health/llm
Expected Output:
{"provider":"ollama","model":"llama3.1:8b","display_name":"Ollama • llama3.1:8b","status":"healthy"}
Recommended Nginx configuration for SSL termination and SSE streaming support:
server {
listen 443 ssl http2;
server_name mlcopilot.yourdomain.com;
ssl_certificate /etc/letsencrypt/live/mlcopilot.yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mlcopilot.yourdomain.com/privkey.pem;
# Frontend Next.js Proxy
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
# API & SSE Stream Proxy
location /api/ {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
# SSE Streaming headers
proxy_buffering off;
proxy_cache off;
proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding on;
}
}-
Database Backup:
docker compose exec postgres pg_dump -U mlcopilot mlcopilot_db > backup_$(date +%F).sql
-
Logs Inspection:
docker compose logs -f api