Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

add xspace-agent/docker-compose.yml

oversteppinga88eb5abf58b
diff --git a/xspace-agent/docker-compose.yml b/xspace-agent/docker-compose.yml
new file mode 100644
index 000000000..48afa7042
--- /dev/null
+++ b/xspace-agent/docker-compose.yml
@@ -0,0 +1,133 @@
+services:
+ agent:
+ build:
+ context: .
+ dockerfile: Dockerfile
+ container_name: xspace-agent
+ restart: unless-stopped
+ ports:
+ - "${PORT:-3000}:3000"
+ env_file:
+ - .env
+ environment:
+ - NODE_ENV=production
+ - PORT=3000
+ - HEADLESS=true
+ - BROWSER_MODE=managed
+ - DATABASE_URL=postgresql://${POSTGRES_USER:-xspace}:${POSTGRES_PASSWORD:-xspace}@postgres:5432/${POSTGRES_DB:-xspace}
+ - REDIS_URL=redis://redis:6379
+ depends_on:
+ postgres:
+ condition: service_healthy
+ redis:
+ condition: service_healthy
+ volumes:
+ - agent-cookies:/app/cookies
+ - agent-data:/app/data
+ # Chromium needs shared memory
+ shm_size: '2gb'
+ security_opt:
+ - no-new-privileges:true
+ deploy:
+ resources:
+ limits:
+ memory: 4g
+ cpus: '2.0'
+ reservations:
+ memory: 1g
+ cpus: '0.5'
+ healthcheck:
+ test: ["CMD", "node", "-e", "fetch('http://localhost:3000/health').then(r => r.ok ? process.exit(0) : process.exit(1)).catch(() => process.exit(1))"]
+ interval: 30s
+ timeout: 10s
+ start_period: 60s
+ retries: 3
+ logging:
+ driver: json-file
+ options:
+ max-size: "50m"
+ max-file: "5"
+
+ # PostgreSQL for persistent data
+ postgres:
+ image: postgres:16-alpine
+ container_name: xspace-postgres
+ restart: unless-stopped
+ ports:
+ - "${POSTGRES_PORT:-5432}:5432"
+ environment:
+ POSTGRES_USER: ${POSTGRES_USER:-xspace}
+ POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-xspace}
+ POSTGRES_DB: ${POSTGRES_DB:-xspace}
+ volumes:
+ - postgres-data:/var/lib/postgresql/data
+ healthcheck:
+ test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-xspace}"]
+ interval: 10s
+ timeout: 5s
+ retries: 5
+ deploy:
+ resources:
+ limits:
+ memory: 1g
+ cpus: '1.0'
+
+ # Redis for cache, sessions, and real-time state
+ redis:
+ image: redis:7-alpine
+ container_name: xspace-redis
+ restart: unless-stopped
+ ports:
+ - "6379:6379"
+ volumes:
+ - redis-data:/data
+ command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
+ healthcheck:
+ test: ["CMD", "redis-cli", "ping"]
+ interval: 10s
+ timeout: 5s
+ retries: 3
+
+ # Optional: Prometheus for metrics collection
+ prometheus:
+ image: prom/prometheus:latest
+ container_name: xspace-prometheus
+ restart: unless-stopped
+ ports:
+ - "9090:9090"
+ volumes:
+ - ./docker/prometheus.yml:/etc/prometheus/prometheus.yml:ro
+ - prometheus-data:/prometheus
+ profiles:
+ - with-monitoring
+ command:
+ - '--config.file=/etc/prometheus/prometheus.yml'
+ - '--storage.tsdb.retention.time=7d'
+
+ # Optional: Grafana for dashboards
+ grafana:
+ image: grafana/grafana:latest
+ container_name: xspace-grafana
+ restart: unless-stopped
+ ports:
+ - "3001:3000"
+ environment:
+ - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-admin}
+ - GF_USERS_ALLOW_SIGN_UP=false
+ volumes:
+ - grafana-data:/var/lib/grafana
+ - ./docker/grafana/provisioning:/etc/grafana/provisioning:ro
+ profiles:
+ - with-monitoring
+ depends_on:
+ - prometheus
+
+volumes:
+ agent-cookies:
+ agent-data:
+ postgres-data:
+ redis-data:
+ prometheus-data:
+ grafana-data:
+
+