File size: 569 Bytes
22fd41f 7ae27cd 22fd41f 7ae27cd 22fd41f 7ae27cd 22fd41f 7ae27cd 6c174fd 22fd41f 6c174fd 7ae27cd 6c174fd | 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 | FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Create a non-root user for HF compliance
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Set working directory to user's home
WORKDIR $HOME/app
# Copy application code and set ownership to our user
COPY --chown=user . $HOME/app
# Ensure the start script is executable
RUN chmod +x start.sh
# HF Spaces requires port 7860
EXPOSE 7860
CMD ["./start.sh"] |