Spaces:
Sleeping
Sleeping
File size: 582 Bytes
45f32de fcc0709 45f32de fcc0709 45f32de fcc0709 45f32de fcc0709 45f32de fcc0709 45f32de fcc0709 45f32de fcc0709 45f32de fcc0709 | 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 | FROM python:3.10-slim
RUN useradd -m -u 1000 user
USER root
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 libglib2.0-0 libsm6 libxrender1 libxext6 \
&& rm -rf /var/lib/apt/lists/*
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# Force Python to print immediately — critical for HF health checks
ENV PYTHONUNBUFFERED=1
WORKDIR /app
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY --chown=user server.py .
COPY --chown=user models/ ./models/
EXPOSE 7860
CMD ["python", "server.py"]
|