| FROM python:3.11-slim |
|
|
| WORKDIR /app |
|
|
| ENV PYTHONUNBUFFERED=1 \ |
| MODEL_DIR=/app/KhanhTTS-OmniVoice \ |
| DEVICE_MAP=cpu \ |
| TORCH_DTYPE=float32 \ |
| TORCH_THREADS=2 |
|
|
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| git \ |
| ffmpeg \ |
| libsndfile1 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| COPY requirements.txt . |
|
|
| RUN pip install --no-cache-dir --upgrade pip |
|
|
| |
| RUN pip install --no-cache-dir \ |
| torch torchaudio \ |
| --index-url https://download.pytorch.org/whl/cpu |
|
|
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| COPY app/ ./app/ |
|
|
| EXPOSE 7860 |
|
|
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] |