use fast souces

This commit is contained in:
2026-10-08 11:40:52 +08:00
parent 4746331515
commit 176d722c77
8 changed files with 70 additions and 8 deletions

View File

@@ -51,6 +51,8 @@ cp -a whisper/. /opt/whisper/ # 用 whisper/. 而不是 whisper/*,否则不
cd /opt/whisper
cp .env.example .env # 按需修改 WHISPER_MODEL
# 默认从 DaoCloud 拉 ghcr 镜像;能直连 GitHub 时在 .env 里设
# WHISPER_IMAGE=ghcr.io/speaches-ai/speaches:latest-cuda
docker compose up -d
docker compose logs -f whisper # 首次启动下载模型(约 3 GB)
```
@@ -195,6 +197,33 @@ AI_MODEL=gpt-4o-mini
`http://127.0.0.1:9000/v1/audio/transcriptions`,并把 `MOSS_MODEL` 设为
`Systran/faster-whisper-large-v3`。
Dockerfile 默认使用国内镜像源,避免构建时从 Docker Hub / Debian / PyPI 直连过慢:
- 基础镜像:`docker.m.daocloud.io/library/python:3.12-slim`
- apt:`mirrors.aliyun.com`
- pip:清华 `https://pypi.tuna.tsinghua.edu.cn/simple`
如需覆盖,可在 `sentence_api/.env` 或构建命令前设置:
```bash
export PYTHON_IMAGE=python:3.12-slim # 能直连 Docker Hub 时
export PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple
export PIP_TRUSTED_HOST=mirrors.aliyun.com
export APT_MIRROR=mirrors.tuna.tsinghua.edu.cn
```
拉 Docker Hub 官方镜像仍然慢时,把仓库里的 `sentence_api/docker-daemon.json.example`
拷到 Docker 配置并重启:
```bash
sudo mkdir -p /etc/docker
sudo cp sentence_api/docker-daemon.json.example /etc/docker/daemon.json
sudo systemctl restart docker
```
`registry-mirrors` 只加速 `docker.io`。Whisper 的 `ghcr.io` 镜像请用 compose 里默认的
DaoCloud 前缀(见第 2A 节)。
启动:
```bash