| # Use a Python base image | |
| FROM python:3.9-slim | |
| # Set the working directory | |
| WORKDIR /code | |
| # Install necessary system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| git \ | |
| build-essential \ | |
| gcc \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Clone the ChatTTS repository | |
| RUN git clone https://github.com/2noise/ChatTTS.git && \ | |
| cd ChatTTS && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| ENV HF_HOME=/code/.cache | |
| # Copy the API files | |
| COPY . /code | |
| # Install dependencies for the API | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Command to run the application | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |