Spaces:
Sleeping
Sleeping
File size: 731 Bytes
b08fcb7 ce14b91 b08fcb7 ce14b91 b08fcb7 5a58d49 ce14b91 7f2584b b08fcb7 | 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 | # Hugging Face Spaces Dockerfile
FROM python:3.11-slim
ENV DEBIAN_FRONTEND=noninteractive
# Install sistem dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git build-essential && \
rm -rf /var/lib/apt/lists/*
# Install dependencies sebagai root
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt
# Buat user dengan UID 1000
RUN useradd -m -u 1000 user
# Switch ke user dan setup home directory
USER user
ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
# Working directory di home user (writable)
WORKDIR $HOME/app
# Copy app dengan ownership yang benar
COPY --chown=user . $HOME/app
EXPOSE 7860
CMD ["python", "app.py"] |