###1. 先进入开发目录,重新构建 cosyvoice 镜像
powershell
cd E:\My_Dream_2026_4_7\Flower_AI
docker build -t flower-ai/cosyvoice:latest .\docker\cosyvoice
这一步的作用是把你最新的:
powershell
docker/cosyvoice/cosyvoice_server.py
重新打进镜像。
2. 进入交付 compose 目录
powershell
cd E:\Aflower\compose
确认这里有:
powershell
docker-compose.yml
.env
3. 停掉旧 cosyvoice 容器
powershell
docker rm -f cosyvoice
4. 用交付版 compose 重新启动 cosyvoice
powershell
docker compose up -d cosyvoice
这一步会读取:
powershell
E:\Aflower\compose\.env
也就是:
powershell
AFLOWER_HOME=E:/Aflower
FLOWER_INTERNAL_TOKEN=...
然后把:
powershell
E:/Aflower/data/output/cosyvoice
挂到容器:
powershell
/app/audio
5. 检查容器是否用了正确挂载
powershell
docker inspect cosyvoice --format "{{json .Mounts}}"
你要看到:
powershell
E:\Aflower\data\output\cosyvoice
-> /app/audio
6. 检查 token 是否进容器
powershell
docker exec -it cosyvoice bash -lc "echo FLOWER_INTERNAL_TOKEN=$FLOWER_INTERNAL_TOKEN"
应该输出 .env 里的那串 token。
7. 检查音频目录
powershell
docker exec -it cosyvoice bash -lc "ls -lh /app/audio | tail -20"
宿主机也查:
powershell
dir E:\Aflower\data\output\cosyvoice
这两个应该同步。
不要混用这两个 compose
现在规则固定下来:
powershell
开发目录 docker-compose.yml
只用于开发调试 / build 参考
交付目录 E:\Aflower\compose\docker-compose.yml
只用于启动运行环境
如果你要启动全部交付容器:
powershell
cd E:\Aflower\compose
docker compose up -d
如果只更新 cosyvoice:
powershell
cd E:\My_Dream_2026_4_7\Flower_AI
docker build -t flower-ai/cosyvoice:latest .\docker\cosyvoice
cd E:\Aflower\compose
docker rm -f cosyvoice
docker compose up -d --force-recreate cosyvoice
IDEA 的作用
IDEA 里加:
powershell
-Daflower.home=E:/Aflower
只影响 Java 后端读取:
powershell
E:\Aflower\data
E:\Aflower\license
E:\Aflower\logs
它不会自动更新 Docker 容器。
Docker 容器必须用:
powershell
cd E:\Aflower\compose
docker compose up -d
来启动。
彻底关闭 ComfyUI-Manager,启动时移除:
powershell
command: >
sh -c "
rm -rf /comfyui/custom_nodes/ComfyUI-Manager &&
python main.py --listen 0.0.0.0 --port 8189 --enable-cors-header --lowvram
"