FROM paraformer-asr:npu-310p

ENV TORCH_DEVICE_BACKEND_AUTOLOAD=0 \
    OPENBLAS_NUM_THREADS=4 \
    OMP_NUM_THREADS=4 \
    PYTHONUNBUFFERED=1 \
    ASR_PORT=9805 \
    ASR_ENGINE=paraformer

WORKDIR /opt/asr-cpu

COPY app.py /opt/asr-cpu/app.py
COPY requirements.txt /opt/asr-cpu/requirements.txt

RUN python3 -m pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple -r /opt/asr-cpu/requirements.txt

CMD ["python3", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "9805"]
