version: '3.8' # Docker Compose for MCP Excalidraw # # Usage scenarios: # 1. Canvas only: docker-compose up canvas # 2. MCP only: docker-compose up mcp (requires canvas running elsewhere) # 3. Both: docker-compose --profile full up # # Most common: Run canvas locally, MCP via Claude Desktop config services: # Canvas server (optional) - Visual UI and REST API canvas: build: context: . dockerfile: Dockerfile.canvas args: - CUSTOM_VITE_WS_URL=${CUSTOM_VITE_WS_URL:-excalidraw.forkless.com} image: celstnblacc/excalidraw-mcp-sentinel-canvas:latest container_name: mcp-excalidraw-canvas ports: - "3000:3000" environment: - NODE_ENV=production - PORT=3000 # HOST=0.0.0.0 is intentional in Docker — the container's port is # exposed only via the published port mapping above. For local dev # without Docker, the default is localhost (set in src/server.ts). - HOST=0.0.0.0 - DEBUG=false # Optional: set to enable API key auth on all /api/* routes. # Must match EXCALIDRAW_API_KEY in the mcp service below so inter-service calls succeed. - EXCALIDRAW_API_KEY=${EXCALIDRAW_API_KEY:-} restart: unless-stopped healthcheck: test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))"] interval: 30s timeout: 10s retries: 3 start_period: 40s deploy: resources: limits: cpus: '1.0' memory: 512M networks: - mcp-network # MCP server - Core product (typically run via Claude Desktop, not docker-compose) # This is here for testing or special deployment scenarios mcp: build: context: . dockerfile: Dockerfile image: celstnblacc/excalidraw-mcp-sentinel:latest container_name: mcp-excalidraw-mcp stdin_open: true tty: true environment: - NODE_ENV=production - EXPRESS_SERVER_URL=http://canvas:3000 - ENABLE_CANVAS_SYNC=true - DEBUG=false # Must match canvas EXCALIDRAW_API_KEY so inter-service sync calls are authenticated. - EXCALIDRAW_API_KEY=${EXCALIDRAW_API_KEY:-} depends_on: canvas: condition: service_healthy deploy: resources: limits: cpus: '0.5' memory: 256M networks: - mcp-network profiles: - full networks: mcp-network: driver: bridge