Spaces:
Sleeping
Sleeping
| # Small Object Detection — Docker Space | |
| # Match local: Python 3.10, pinned deps (requirements-lock.txt). Gradio on 7860. | |
| FROM python:3.10-slim-bookworm | |
| # System deps: font for draw_label; opencv/ultralytics headless (libxcb, glib, etc.) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| fonts-dejavu-core \ | |
| libglib2.0-0 \ | |
| libxcb1 \ | |
| libxcb-shm0 \ | |
| libxcb-xfixes0 \ | |
| libxrender1 \ | |
| libsm6 \ | |
| libxext6 \ | |
| libgl1-mesa-glx \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # HF Spaces run as user 1000 | |
| RUN useradd -m -u 1000 user | |
| ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH | |
| WORKDIR $HOME/app | |
| USER user | |
| # Install Python deps from lock file so Space matches local versions (no GPU at build time) | |
| COPY --chown=user requirements-lock.txt . | |
| RUN pip install --no-cache-dir --upgrade pip \ | |
| && pip install --no-cache-dir -r requirements-lock.txt \ | |
| && pip uninstall -y accelerate | |
| # App code (refs/ and code) | |
| COPY --chown=user . . | |
| # Gradio must listen on 0.0.0.0 for Docker | |
| ENV GRADIO_SERVER_NAME=0.0.0.0 | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] | |