Docker & Cloud-Native Deployment
Deploy CHANGENTS.AI using Docker Compose for single-server setups or Kubernetes/Helm for scalable cloud deployments.
Docker Compose (Single Server)
Suitable for: small teams, internal deployments, staging environments.
Prerequisites
- Docker Engine 24+
- Docker Compose 2.20+
- 4GB+ RAM, 20GB+ disk
Setup
bash
# Clone the repository
git clone https://github.com/yourco/changents-ai.git
cd changents-ai
# Copy and edit environment variables
cp .env.example .env
# Edit .env with your configuration (see Environment Variables)
# Start all services
docker compose up -d
# Check service health
docker compose psdocker-compose.yml Services
| Service | Port | Description |
|---|---|---|
app | 3000 | Expo web frontend (Next.js-like) |
backend | 3001 | Express.js API server |
mongodb | 27017 | MongoDB database |
redis | 6379 | Redis cache and sessions |
ollama | 11434 | On-premise LLM (optional) |
nginx | 80, 443 | Reverse proxy and SSL termination |
Nginx Configuration
The included nginx.conf routes:
/→ frontend (port 3000)/api→ backend (port 3001)/socket.io→ backend WebSocket
Docker Compose — Production Checklist
Before going live:
- [ ] All secrets in
.envare unique, randomly generated - [ ]
NODE_ENV=productionis set - [ ] MongoDB runs with authentication enabled
- [ ] Redis is password-protected
- [ ] SSL certificate is installed in Nginx
- [ ] Ports 27017 and 6379 are not exposed to the public internet
- [ ] Backups configured for MongoDB data volume
Scaling with Docker Compose
Scale the backend horizontally:
bash
docker compose up -d --scale backend=3Nginx load-balances across backend instances automatically (upstream block in nginx.conf).
Kubernetes / Helm
For large-scale production deployments, a Helm chart is available for Enterprise customers.
bash
# Add the CHANGENTS.AI Helm repository
helm repo add changents https://charts.changents.ai
helm repo update
# Install with your values
helm install changents changents/changents-ai \
--namespace changents \
--create-namespace \
--values values.yamlvalues.yaml example
yaml
global:
domain: agents.yourcompany.com
tls: true
backend:
replicas: 3
resources:
requests: { cpu: '500m', memory: '512Mi' }
limits: { cpu: '2', memory: '2Gi' }
frontend:
replicas: 2
mongodb:
enabled: false
externalUri: 'mongodb+srv://...' # Use your own Atlas or managed MongoDB
redis:
enabled: true
persistence:
enabled: true
size: 10Gi
llm:
enabled: false # Set true for on-prem Ollama
model: llama3.2Health Checks
Monitor service health:
bash
# Application health
curl http://localhost:3001/api/health
# MongoDB connection
docker exec changents_backend node -e "require('./backend/server').healthCheck()"
# Redis connection
docker exec changents_redis redis-cli pingLogs
bash
# All services
docker compose logs -f
# Specific service
docker compose logs -f backend
# Since timestamp
docker compose logs --since 1h backendUpdates
bash
# Pull latest images
docker compose pull
# Restart with new images (zero downtime with rolling update)
docker compose up -d --no-deps --build backend
docker compose up -d --no-deps --build app