xiaozhi-esp32-server/main/xiaozhi-server/docker-compose.yml
MOLVMIN 1d66fa6473 feat(vision): 识别命中后回调 NFC 写卡服务
- vision_handler:识别到手办后调用 _write_figurine_nfc(),POST 主机侧
  figurine-nfc-writer 服务(FIGURINE_NFC_WRITER_URL)向公仔卡写角色名;
  写卡失败不阻塞语音播报(降级)
- docker-compose:新增 FIGURINE_NFC_WRITER_URL 环境变量
  (http://host.docker.internal:8005/write)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 14:49:16 +08:00

34 lines
No EOL
1.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Docker安装Server
version: '3'
services:
xiaozhi-esp32-server:
image: ghcr.nju.edu.cn/xinnan-tech/xiaozhi-esp32-server:server_latest
container_name: xiaozhi-esp32-server
restart: always
security_opt:
- seccomp:unconfined
environment:
- TZ=Asia/Shanghai
# 手办识别微服务地址(tools/figurine-recognizer 跑在宿主机 8004 端口)
- FIGURINE_RECOGNIZER_URL=http://host.docker.internal:8004/recognize
# 手办 NFC 写卡服务地址(tools/figurine-nfc-writer 跑在宿主机 8005 端口,主机原生运行以访问USB串口)
# 留空则识别命中后不写卡;填上则识别命中自动向公仔卡写角色名
- FIGURINE_NFC_WRITER_URL=http://host.docker.internal:8005/write
# 采集设备实拍照片到 data/vision_captures/(采集完设备参考图后可关掉)
- SAVE_VISION_CAPTURES=1
extra_hosts:
# 让容器能通过 host.docker.internal 访问宿主机(Linux 上需要,Docker Desktop 自带)
- "host.docker.internal:host-gateway"
ports:
# ws服务端
- "8000:8000"
# http服务的端口,用于简单OTA接口(单服务部署),以及视觉分析接口
- "8003:8003"
volumes:
# 配置文件目录
- ./data:/opt/xiaozhi-esp32-server/data
# 模型文件挂接,很重要
- ./models/SenseVoiceSmall/model.pt:/opt/xiaozhi-esp32-server/models/SenseVoiceSmall/model.pt
# 手办识别接线补丁:用 fork 里改过的 vision_handler.py 覆盖镜像内的原文件
- ./core/api/vision_handler.py:/opt/xiaozhi-esp32-server/core/api/vision_handler.py