# PAC ASR — SenseVoice-small(sherpa-onnx,纯 CPU,无 torch)
# 模型经卷挂载(SENSEVOICE_DIR),镜像本身 < 400MB。
# 国内服务器构建提速:--build-arg DEBIAN_MIRROR=mirrors.aliyun.com --build-arg PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple
FROM python:3.11-slim

ARG PIP_INDEX_URL=https://pypi.org/simple
ARG DEBIAN_MIRROR=

RUN if [ -n "$DEBIAN_MIRROR" ]; then \
      sed -i "s/deb.debian.org/${DEBIAN_MIRROR}/g" /etc/apt/sources.list.d/debian.sources; \
    fi \
    && apt-get update \
    && apt-get install -y --no-install-recommends ffmpeg \
    && rm -rf /var/lib/apt/lists/*

RUN pip install --no-cache-dir -i ${PIP_INDEX_URL} \
    "sherpa-onnx>=1.10,<2" numpy fastapi "uvicorn[standard]" python-multipart

WORKDIR /app
COPY apps/asr-sensevoice/server.py .

EXPOSE 8000
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "8000"]
