voice-cloning-backend / Dockerfile
AJ50's picture
Switch to Python 3.11 to avoid TTS numpy==1.22.0 constraint. Use numpy 1.24.3 compatible with all packages.
3435f33
raw
history blame
891 Bytes
FROM python:3.11-slim
# Install system dependencies including build tools and BLAS/LAPACK for scipy
RUN apt-get update && apt-get install -y \
build-essential \
libsndfile1 libsndfile1-dev \
ffmpeg \
git \
libblas-dev liblapack-dev gfortran \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy entire project
COPY . .
# Install Python dependencies
RUN pip install --no-cache-dir -r backend/requirements.txt
# Note: Models will be downloaded on first request
# Skipping download_models.py to avoid build timeout on HF Spaces
# - English models: Downloaded via hf_hub_download on first voice enrollment/synthesis
# - Hindi XTTS: Downloaded via TTS library on first Hindi synthesis request
# Expose port (HF Spaces uses 7860)
EXPOSE 7860
# Start the application
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "1", "--timeout", "300", "backend.wsgi:app"]