File size: 744 Bytes
ba3cc76
d1436c2
 
54d9633
 
 
 
 
 
ba3cc76
d1436c2
ba3cc76
 
d1436c2
ba3cc76
 
d1436c2
ba3cc76
54d9633
 
 
d1436c2
 
54d9633
 
 
 
 
 
 
 
d1436c2
ba3cc76
54d9633
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
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
FROM python:3.9-slim

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

# Create a non-root user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

# Set working directory
WORKDIR /app

# Copy requirements first for better caching
COPY --chown=user requirements.txt .

# Install Python dependencies
RUN pip install --no-cache-dir --upgrade -r requirements.txt

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

# Create directories for uploads
RUN mkdir -p static/images

# Expose port
EXPOSE 7860

# Command to run the application
CMD ["python", "app.py"]