File size: 787 Bytes
c9f07b9
 
 
 
a108752
c9f07b9
900bd70
c9f07b9
900bd70
 
c9f07b9
 
a108752
c9f07b9
 
 
a108752
c9f07b9
 
a108752
c9f07b9
 
 
 
a108752
c9f07b9
 
a108752
c9f07b9
d0f44d0
 
 
 
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
33
FROM python:3.10-slim

WORKDIR /app

# Install system dependencies FIRST
RUN apt-get update && apt-get install -y \
    libffi-dev \
    libsndfile1 \
    libasound2 \
    libxt6 \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements
COPY requirements.txt .

# Install Python dependencies in CORRECT ORDER
# numpy MUST be first, before torch/torchaudio
RUN pip install --no-cache-dir "numpy>=1.24.0,<2.0.0"

RUN pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY . .

# Expose port
EXPOSE 7860

# Run with proper Python settings
ENV PYTHONUNBUFFERED=1

# Run with uvicorn directly (required for HuggingFace Spaces)
# Use PORT environment variable if provided, otherwise default to 7860
CMD uvicorn app:app --host 0.0.0.0 --port ${PORT:-7860} --log-level info