docker-compose.yml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. services:
  2. feishu:
  3. build:
  4. context: .
  5. dockerfile: docker/Dockerfile.feishu
  6. image: agent/feishu:latest
  7. container_name: agent-feishu
  8. restart: unless-stopped
  9. volumes:
  10. - ./gateway/core/channels/feishu/openclaw-lark-patch/src/http/config.yml:/app/config.yml
  11. env_file:
  12. - .env
  13. environment:
  14. - FEISHU_HTTP_PORT=4380
  15. - GATEWAY_FEISHU_WEBHOOK_URL=http://gateway:8000/api/channels/feishu/inbound/webhook
  16. ports:
  17. - "4380:4380"
  18. networks:
  19. - agent
  20. server:
  21. build:
  22. context: .
  23. dockerfile: docker/Dockerfile.server
  24. image: agent/server:latest
  25. profiles:
  26. - build-only
  27. api:
  28. image: agent/server:latest
  29. container_name: agent-api
  30. restart: unless-stopped
  31. env_file:
  32. - .env
  33. environment:
  34. - FEISHU_HTTP_BASE_URL=http://feishu:4380
  35. volumes:
  36. - /var/run/docker.sock:/var/run/docker.sock:ro
  37. ports:
  38. - "8001:8000"
  39. entrypoint: "python /app/api_server.py"
  40. networks:
  41. - agent
  42. gateway:
  43. image: agent/server:latest
  44. container_name: agent-gateway
  45. restart: unless-stopped
  46. env_file:
  47. - .env
  48. environment:
  49. - FEISHU_HTTP_BASE_URL=http://feishu:4380
  50. - GATEWAY_AGENT_API_BASE_URL=http://api:8000
  51. - CHANNELS_DISPATCH_REACTIONS=false
  52. - CHANNELS_DISPATCH_CARD_ACTIONS=true
  53. # Workspace 沙箱:与下方命名卷一致(Compose 项目名为 agent 时卷名为 agent_workspace_root)
  54. - GATEWAY_WORKSPACE_DOCKER_NETWORK=agent
  55. - GATEWAY_WORKSPACE_MOUNT_MODE=volume_subpath
  56. - GATEWAY_WORKSPACE_DOCKER_VOLUME=agent_workspace_root
  57. - GATEWAY_SHARED_DOCKER_VOLUME=agent_workspace_shared
  58. volumes:
  59. # workspace 与 shared 数据卷
  60. - workspace_root:/root/.gateway/workspaces
  61. - workspace_shared:/root/.gateway/shared
  62. # 将宿主机的 docker.sock 暴露给 gateway,用于创建 workspace 容器
  63. - /var/run/docker.sock:/var/run/docker.sock:ro
  64. ports:
  65. - "8002:8000"
  66. entrypoint: "python /app/gateway_server.py"
  67. networks:
  68. - agent
  69. workspace:
  70. build:
  71. context: .
  72. dockerfile: docker/Dockerfile.workspace
  73. image: agent/workspace:latest
  74. profiles:
  75. - build-only
  76. volumes:
  77. workspace_root:
  78. name: agent_workspace_root
  79. workspace_shared:
  80. name: agent_workspace_shared
  81. driver: local
  82. driver_opts:
  83. type: none
  84. o: bind
  85. device: ${GATEWAY_SHARED_HOST_BIND:-${PWD}/.gateway/shared}
  86. networks:
  87. agent:
  88. name: agent