File size: 708 Bytes
05524ae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
02a797c
05524ae
 
 
 
 
 
 
 
 
 
 
4ed5664
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
# Use Python 3.9
FROM python:3.9-slim

# Set working directory
WORKDIR /app

# Install system dependencies (Fixes issues with cv2 and soundfile)
RUN apt-get update && apt-get install -y \
    ffmpeg \
    libsm6 \
    libxext6 \
    libsndfile1 \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements and install python packages
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy all your app code
COPY . .

# Create a user (Hugging Face security requirement)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

# Run the app on port 7860 (Hugging Face Default)
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app", "--timeout", "120"]