Files
audio2text/docker-compose.yml
audio2text dev 73110848f4 feat: 调度器+并发管线+GPU优化+日志分级+前端修复
- scheduler: ffmpeg 异步线程 + GPU 串行调度 + 模型复用(2N→2 次加载)
- pipeline: 阶段拆分(extract/asr/translate),中间数据存 Task 字段
- translate_service: 长度排序批处理,padding 浪费减少 91%
- model_manager: ASR/翻译不共驻,BatchedInferencePipeline 批量解码
- 日志分级: INFO=任务流转里程碑,DEBUG=进度详情;默认 INFO
- 前端: 日志最新在上+滚动感知+退避轮询;24h 时间;上传中状态显示
- /health: 返回完整 Whisper/NLLB 配置
- upload_service: 单事务 complete + 扩展名白名单
- task_router: 合并 UploadSession 虚拟任务到列表
- Dockerfile: CPU/GPU 独立构建链,deps 缓存稳定
- prefetch_models: 安装时预下载模型权重
2026-07-06 21:59:59 +08:00

83 lines
2.1 KiB
YAML
Raw Permalink 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.

# audio2text — 双语字幕生成服务
# CPU dev / GPU prod 两套配置,按需切换 service。
#
# 开发CPU热重载改代码零重建
# docker compose --profile dev up -d --build
# CPU 生产:
# docker compose --profile cpu up -d --build
# GPU 生产(本机有 nvidia runtime 时):
# docker compose --profile gpu up -d --build
#
# 模型缓存(/models跨容器复用首次启动下载、之后秒起。
# pip wheel 缓存由 BuildKit --mount=type=cache 管理,跨构建复用。
services:
# ---------------- 开发CPU + 源码挂载 + uvicorn reload ----------------
# 改 app/ 下代码无需重建镜像,保存即热重载。
audio2text-cpu-dev:
build:
context: .
args:
VARIANT: cpu
target: dev
image: audio2text:cpu-dev
container_name: audio2text-dev
ports:
- "8000:8000"
volumes:
- ./app:/app/app
- ./data:/data
- ./models:/models
- ./config.yaml:/app/config.yaml:ro
environment:
CONFIG_PATH: /app/config.yaml
restart: unless-stopped
profiles: ["dev"]
# ---------------- CPU 生产 ----------------
audio2text-cpu:
build:
context: .
args:
VARIANT: cpu
target: final
image: audio2text:cpu
container_name: audio2text
ports:
- "8000:8000"
volumes:
- ./data:/data
- ./models:/models
- ./config.yaml:/app/config.yaml:ro
environment:
CONFIG_PATH: /app/config.yaml
restart: unless-stopped
profiles: ["cpu", ""]
# ---------------- GPU 生产 ----------------
audio2text-gpu:
build:
context: .
args:
VARIANT: gpu
target: final
image: audio2text:gpu
container_name: audio2text-gpu
ports:
- "8001:8000"
volumes:
- ./data:/data
- ./models:/models
- ./config.gpu.yaml:/app/config.yaml:ro
environment:
CONFIG_PATH: /app/config.yaml
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
restart: unless-stopped
profiles: ["gpu"]