Skip to content
Back to the app

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 ps

docker-compose.yml Services ​

ServicePortDescription
app3000Expo web frontend (Next.js-like)
backend3001Express.js API server
mongodb27017MongoDB database
redis6379Redis cache and sessions
ollama11434On-premise LLM (optional)
nginx80, 443Reverse 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 .env are unique, randomly generated
  • [ ] NODE_ENV=production is 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=3

Nginx 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.yaml

values.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.2

Health 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 ping

Logs ​

bash
# All services
docker compose logs -f

# Specific service
docker compose logs -f backend

# Since timestamp
docker compose logs --since 1h backend

Updates ​

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

What's Next? ​

Served from this deployment. No page view leaves it.