> ## Documentation Index
> Fetch the complete documentation index at: https://docs.asktable.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 飞书网关

> 飞书网关是私有部署里的可选组件，负责飞书 IM 的长连接。本页说明它的作用和如何在 compose 里启用。

飞书网关（`asktable-feishu-gateway`）是私有部署里的**可选组件**，只有当你要让团队在飞书群里 `@bot` 问数时才需要它。它通过 Redis 与 AskTable 后端通信，维持飞书 IM 的 WebSocket 长连接。

不接飞书的话，不用加这个容器。

## 在 compose 里启用

在 [私有部署](/deploy/docker) 的 `docker-compose.yaml` 里加上这个服务：

```yaml theme={null}
services:
  # 飞书网关（可选）：接入飞书 IM 时才需要
  asktable-feishu-gateway:
    image: registry.cn-shanghai.aliyuncs.com/datamini/asktable-feishu-gateway:latest  # 中国大陆；海外用 datamini/asktable-feishu-gateway:latest
    container_name: asktable-feishu-gateway
    restart: unless-stopped
    depends_on:
      - asktable-redis
    environment:
      TZ: Asia/Shanghai
      REDIS_URL: redis://asktable-redis:6379
```

它和主服务共用同一个 `asktable-redis`，无需额外暴露端口。改完执行 `docker compose up -d` 生效。

## 下一步

容器起好后，飞书应用的创建、凭证配置、把机器人加进群等步骤，见 [在飞书中连接数据智能体](/how-to/connect-feishu)。
