# ============================================ # WeLe Agentic AI — deployment # # Runs alongside the existing CRM stack rather than inside it. Joining the # CRM's network (`whatsapp-crm_default`) lets this service reach `redis` and # `whatsapp-api` by name, without publishing anything extra or duplicating a # Redis on a 3.7 GB box. # # The voice service is not here on purpose — it needs a CUDA GPU. See DEPLOY.md. # ============================================ services: agentic-ai: build: . image: wele/agentic-ai:latest container_name: wele-agentic-ai restart: always # Host 4000 is free. The CRM's chat-service also listens on 4000, but only # inside its own container — it publishes nothing, so there is no clash. ports: - "4000:4000" env_file: - .env environment: - NODE_ENV=production - PORT=4000 # Reuse the CRM's Redis by service name on the shared network. # Keys are namespaced with REDIS_PREFIX, so the two never collide. - REDIS_ENABLED=true - REDIS_HOST=redis - REDIS_PORT=6379 # Quoted: a trailing colon makes YAML parse this as a map, not a string. - "REDIS_PREFIX=agentic:" # Writes go through the CRM's own REST routes so its lead scoring, # socket events and audit trail still fire. Reached over the shared # network, so this never leaves the host. - "CRM_API_BASE=http://whatsapp-api:3000" # Must match the CRM's JWT_SECRET — that is how a CRM login is accepted # here with the same role and permissions. Sourced from .env so the # secret is never written into this file. - CRM_JWT_SECRET=${CRM_JWT_SECRET:?set CRM_JWT_SECRET in .env — must equal the CRM JWT_SECRET} - MONGODB_URI=${MONGODB_URI:?set MONGODB_URI in .env} volumes: # Generated xlsx/pdf/pptx survive rebuilds; swept on a TTL by the app. - artifacts:/app/storage/artifacts # A 2 vCPU / 3.7 GB host already runs the CRM, chat-service, Redis and # Milvus. Capping this container keeps a runaway turn from starving them. deploy: resources: limits: memory: 768M logging: driver: json-file options: max-size: "10m" max-file: "3" networks: - crm networks: crm: # Created by the CRM's own compose project; we attach, never own it. name: whatsapp-crm_default external: true volumes: artifacts: