Zoodow / Dockerfile
Sairesh's picture
Update Dockerfile
7738270 verified
raw
history blame contribute delete
692 Bytes
FROM python:3.10-slim
# Set up user permissions for Hugging Face
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
# Install system dependencies (using sudo-less approach)
USER root
RUN apt-get update && apt-get install -y \
libglib2.0-0 libgl1 libsm6 libxext6 curl \
&& rm -rf /var/lib/apt/lists/*
USER user
# Install Python requirements
COPY --chown=user requirements.txt $HOME/app/
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy application files
COPY --chown=user . $HOME/app
# Hugging Face looks for port 7860
EXPOSE 7860
CMD ["python", "app.py"]