File size: 845 Bytes
fc40afd
91af9cd
 
 
 
 
 
 
 
 
 
 
02419cd
91af9cd
 
 
 
 
 
 
 
 
 
 
 
 
 
fc40afd
91af9cd
 
 
 
 
 
 
fc40afd
91af9cd
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
35
36
37
38
# Python 3.11: the version this image has been built and run with
FROM python:3.11-slim

WORKDIR /app

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

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

WORKDIR $HOME/app

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

# Copy application code
COPY --chown=user . .

# Expose port
EXPOSE 7860

# Run the API via uvicorn (FastAPI only, no web interface)
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]