File size: 665 Bytes
5d2eba0
d8a5cc9
5d2eba0
d8a5cc9
 
 
 
 
 
5d2eba0
 
 
 
 
 
 
 
 
 
d8a5cc9
5d2eba0
 
d8a5cc9
5d2eba0
 
d8a5cc9
5d2eba0
 
d8a5cc9
5d2eba0
 
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
FROM python:3.11-slim

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

# Create non-root user (required by HF Spaces)
RUN useradd -m -u 1000 user
ENV HOME=/home/user \
    PATH="/home/user/.local/bin:$PATH"

WORKDIR /app

# Copy requirements first to leverage Docker cache
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the entire application
COPY --chown=user . .

# Switch to non-root user
USER user

# Expose the port Hugging Face expects
EXPOSE 7860

# Run the orchestration script
CMD ["python", "main.py"]