FROM python:3.12 | |
RUN useradd -m appuser | |
WORKDIR /app | |
COPY . . | |
RUN chown -R appuser:appuser /app | |
RUN apt-get update && apt-get install -y libgl1 inotify-tools | |
ENV HF_HOME="/app/hf_cache" | |
RUN pip install . | |
COPY entrypoint.sh /app/entrypoint.sh | |
RUN chmod +x /app/entrypoint.sh | |
USER appuser | |
EXPOSE 7860 | |
ENV PYTHONUNBUFFERED=1 | |
ENTRYPOINT ["/app/entrypoint.sh"] | |