File size: 893 Bytes
f68a33a
 
 
 
 
 
 
 
 
 
 
 
 
2b52957
 
f68a33a
 
 
 
 
 
 
 
 
 
1c5dd00
 
 
 
 
 
 
 
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
34
FROM python:3.11-slim

WORKDIR /app

# Install system dependencies for audio processing
RUN apt-get update && apt-get install -y \
    ffmpeg \
    libsndfile1 \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements first for better caching
COPY requirements.txt .

# Install CPU-only PyTorch (Latest Stable)
RUN pip install --no-cache-dir torch torchaudio --index-url https://download.pytorch.org/whl/cpu

# Install remaining requirements (skip torch/torchaudio since already installed)
RUN pip install --no-cache-dir -r requirements.txt || true

# Copy application code
COPY . .

# Expose port (documentary only, but good practice)
EXPOSE 8000

# Create user with UID 1000 (required for HF Spaces)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# Run the application
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]