# Deploy through your project-scoped DeployifyNow managed stack. No datastore ports are published. services: mcp: image: '${MCP_IMAGE:?An immutable reviewed image digest is required}' restart: unless-stopped init: true read_only: true user: '1000:1000' cap_drop: [ALL] security_opt: ['no-new-privileges:true'] pids_limit: 128 mem_limit: 256m cpus: 0.5 tmpfs: ['/tmp:size=16m,mode=1777'] environment: PORT: '3000' SOURCE_REVISION: '${SOURCE_REVISION:?Exact source SHA required}' MCP_PUBLIC_URL: 'https://${MCP_HOST:?Product-owned HTTPS hostname required}/mcp' MCP_ISSUER_URL: '${MCP_ISSUER_URL:?Existing product issuer required}' MCP_JWKS_URL: '${MCP_JWKS_URL:?Existing product JWKS required}' MCP_INTROSPECTION_URL: '${MCP_INTROSPECTION_URL:?Revocation-aware issuer introspection required}' MCP_INTROSPECTION_CLIENT_ID: '${MCP_INTROSPECTION_CLIENT_ID:?Existing protected reference required}' MCP_INTROSPECTION_CLIENT_SECRET_FILE: /run/secrets/introspection MCP_DATABASE_URL_FILE: /run/secrets/database MCP_AUTH_MODE: '${MCP_AUTH_MODE:-jwt-json}' MCP_WORKSPACE: '${MCP_WORKSPACE:-}' MCP_READ_SCOPE: '${MCP_READ_SCOPE:-sample:read}' MCP_WRITE_SCOPE: '${MCP_WRITE_SCOPE:-sample:drafts:write}' MCP_READS_PER_MINUTE: '${MCP_READS_PER_MINUTE:-60}' MCP_WRITES_PER_MINUTE: '${MCP_WRITES_PER_MINUTE:-10}' MCP_ANONYMOUS_PER_MINUTE: '${MCP_ANONYMOUS_PER_MINUTE:-30}' MCP_MAX_CONCURRENCY: '8' secrets: [database, introspection] networks: [private, egress] logging: { driver: json-file, options: { max-size: 5m, max-file: '2' } } labels: org.opencontainers.image.revision: '${SOURCE_REVISION}' deployifynow.capability: mcp-streamable-http deployifynow.datastore-owner: '${MCP_OWNER:?Product/project ownership required}' deploy: replicas: 1 resources: limits: { cpus: '0.5', memory: 256M, pids: 128 } restart_policy: { condition: on-failure, delay: 5s, max_attempts: 5 } gateway: image: nginxinc/nginx-unprivileged:1.29-alpine@sha256:0c79d56aee561a1d81c63f00eee5fb5fe29279560cdc55e91425133104c7fbe6 restart: unless-stopped read_only: true cap_drop: [ALL] security_opt: ['no-new-privileges:true'] pids_limit: 64 mem_limit: 64m cpus: 0.15 volumes: ['./nginx.conf:/etc/nginx/conf.d/default.conf:ro'] tmpfs: ['/tmp:size=8m,mode=1777'] networks: [private, ingress] logging: { driver: json-file, options: { max-size: 5m, max-file: '2' } } depends_on: { mcp: { condition: service_healthy } } labels: - 'traefik.enable=true' - 'traefik.docker.network=dokploy-network' - 'traefik.http.routers.${MCP_OWNER}-mcp.rule=Host(`${MCP_HOST}`) && (Path(`/mcp`) || Path(`/.well-known/oauth-protected-resource/mcp`))' - 'traefik.http.routers.${MCP_OWNER}-mcp.entrypoints=websecure' - 'traefik.http.routers.${MCP_OWNER}-mcp.tls=true' - 'traefik.http.services.${MCP_OWNER}-mcp.loadbalancer.server.port=8080' - 'org.opencontainers.image.revision=${SOURCE_REVISION}' healthcheck: test: ['CMD-SHELL', 'wget -qO /dev/null http://127.0.0.1:8080/health'] interval: 30s timeout: 5s retries: 3 deploy: replicas: 1 resources: limits: { cpus: '0.15', memory: 64M, pids: 64 } networks: private: external: true name: '${MCP_PRIVATE_NETWORK:?Existing product-private datastore network required}' egress: {} ingress: external: true name: dokploy-network secrets: database: file: '${MCP_DATABASE_SECRET_FILE:?Existing product-scoped database secret file required}' introspection: file: '${MCP_INTROSPECTION_SECRET_FILE:?Existing product-scoped introspection secret file required}'