|
|
FROM nvidia/cuda:12.1.1-runtime-ubuntu22.04 |
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \ |
|
|
PYTHONDONTWRITEBYTECODE=1 \ |
|
|
PYTHONUNBUFFERED=1 |
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|
|
python3 python3-pip python3-venv wget ca-certificates && \ |
|
|
ln -sf /usr/bin/python3 /usr/bin/python && \ |
|
|
rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir fastapi==0.115.0 uvicorn[standard]==0.30.6 \ |
|
|
piper-tts==1.2.0 onnxruntime==1.18.1 |
|
|
|
|
|
RUN pip install --no-cache-dir onnxruntime-gpu==1.18.1 || true |
|
|
|
|
|
|
|
|
RUN mkdir -p models && \ |
|
|
wget -O models/en_US-ljspeech-medium.onnx \ |
|
|
https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_US/ljspeech/medium/en_US-ljspeech-medium.onnx && \ |
|
|
wget -O models/en_US-ljspeech-medium.onnx.json \ |
|
|
https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_US/ljspeech/medium/en_US-ljspeech-medium.onnx.json |
|
|
|
|
|
COPY app.py /app/app.py |
|
|
|
|
|
ENV PIPER_MODEL=models/en_US-ljspeech-medium.onnx |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
|
|
|
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--no-access-log"] |
|
|
|