# Hugging Face Docker Space for SupraDashboard. # A Docker Space (not the default Gradio SDK Space) is used so RDKit's native deps # install cleanly and a future live-docking pipeline (xtb) can be added here. FROM python:3.11-slim # RDKit Cairo rendering (MolDraw2DCairo) needs these system libs. # libcairo2 is required or rendering fails silently; libxrender1/libxext6/libsm6 # satisfy RDKit's other native deps on python:3.11-slim. RUN apt-get update && apt-get install -y --no-install-recommends \ libxrender1 libxext6 libsm6 \ libcairo2 \ && rm -rf /var/lib/apt/lists/* # HF Spaces runs as uid 1000; keep a writable home for caches + feedback.db RUN useradd -m -u 1000 user USER user # Default FEEDBACK_DB to the HF persistent-storage mount; feedback.py falls back # to a writable home path if /data is absent/unwritable (storage not attached), # so startup never crashes. Do NOT `mkdir /data` here — the mount only exists at # container runtime, not during build (see docs/GRADIO_SPACES_NOTES.md §7). ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH \ PORT=7860 \ FEEDBACK_DB=/data/feedback.db WORKDIR /home/user/app COPY --chown=user requirements.txt . RUN pip install --no-cache-dir --user -r requirements.txt COPY --chown=user . . EXPOSE 7860 CMD ["python", "src"]