File size: 853 Bytes
81d5a2e
 
1ad9716
81d5a2e
 
 
6ffef62
1ad9716
81d5a2e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1ad9716
 
 
81d5a2e
 
 
1ad9716
 
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
FROM python:3.11-slim

# Install system utilities (including git and psmisc)
RUN apt-get update && apt-get install -y --no-install-recommends \
    curl \
    ca-certificates \
    git \
    psmisc \
    && rm -rf /var/lib/apt/lists/*

# Set up non-root user (UID 1000 required by Hugging Face Spaces)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH \
    PYTHONUNBUFFERED=1

WORKDIR $HOME/app

# Install Python requirements
COPY --chown=user:user requirements.txt $HOME/app/requirements.txt
RUN pip install --no-cache-dir --user -r requirements.txt

# Copy all application code
COPY --chown=user:user . $HOME/app

# Ensure start.sh has execution rights
RUN chmod +x $HOME/app/start.sh

# Expose the default HF Spaces port
EXPOSE 7860

# Start the application cleanly through start.sh
CMD ["./start.sh"]