Spaces:
Running
Running
# Use an official Python runtime as a parent image | |
FROM python:3.9-slim | |
# Set environment variables to accept the TTS licenses and handle numba caching issues | |
ENV TTS_ACCEPT_TOS=1 | |
ENV TTS_LICENSE_ACCEPT=true | |
ENV COQUI_STUDIO_LICENSE=1 | |
ENV COQUI_LICENSE_AGREEMENT=n | |
ENV NUMBA_DISABLE_CACHING=1 | |
# Set the working directory in the container | |
WORKDIR /app | |
# Install system dependencies for librosa | |
RUN apt-get update && apt-get install -y \ | |
libsndfile1 \ | |
libasound2-dev \ | |
libportaudio2 \ | |
libportaudiocpp0 \ | |
portaudio19-dev \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Copy the requirements.txt first to leverage Docker cache | |
COPY requirements.txt /app/ | |
# Install the dependencies | |
RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
# Copy the rest of the application code | |
COPY . /app | |
# Expose the port that Gradio will use | |
EXPOSE 8600 | |
# Command to run the application | |
CMD ["python", "app.py", "--share"] | |