File size: 738 Bytes
e951236
 
0fd8e2e
91a7111
 
 
 
 
 
e951236
0fd8e2e
 
e951236
 
0fd8e2e
 
e951236
0fd8e2e
 
e951236
 
 
 
 
 
 
 
 
 
0fd8e2e
e951236
255ff78
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
# Base image with Python
FROM python:3.13

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

# Create a non-root user for Hugging Face Spaces
RUN useradd -m -u 1000 user
USER user

# Add local pip binaries to PATH
ENV PATH="/home/user/.local/bin:$PATH"

# Set working directory
WORKDIR /app

# Install dependencies
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# Copy all app files
COPY --chown=user . .

# Expose Space’s required port
EXPOSE 7860

# Default command to run FastAPI with Uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]