File size: 654 Bytes
41ca8e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile

FROM python:3.12-slim

# Set working directory
WORKDIR /app

# Create user
RUN useradd -m -u 1000 user

# Copy dependency files first (for better caching)
COPY --chown=user ./requirements.txt requirements.txt

# Install dependencies using pip (more reliable for HF Spaces)
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt

# Copy application files
COPY --chown=user . /app

# Switch to user
USER user

# Expose port
EXPOSE 7860

# Run the Gradio app
CMD ["python", "app.py"]