File size: 1,049 Bytes
3435f33
5008b66
dbdffc6
5008b66
abfe39d
5008b66
 
 
dbdffc6
5008b66
 
 
 
 
 
 
8ba4969
 
5008b66
1b05367
 
 
5008b66
 
 
 
1b05367
 
 
5008b66
1b05367
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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: XTTS model downloads on first startup (via setup_models.py)
# - English models: Local (already in repo)
# - Hindi XTTS: Downloaded from HF Hub to /app/backend/models/ on first deployment

# Expose port (HF Spaces uses 7860)
EXPOSE 7860

# Setup models and start app
RUN echo "#!/bin/bash\nset -e\necho '[Startup] Ensuring models are available...'\npython /app/backend/setup_models.py\necho '[Startup] Models ready, starting gunicorn...'\nexec gunicorn --bind 0.0.0.0:7860 --workers 1 --timeout 300 backend.wsgi:app" > /app/start.sh && chmod +x /app/start.sh

# Start the application
CMD ["/app/start.sh"]