# DTECT - Hugging Face Space (Docker SDK) # Our own Dockerfile, so HF does not add its own "streamlit==" pin, # which conflicted with streamlit==1.46.0 in requirements.txt and broke the build. FROM python:3.10-slim RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential git \ && rm -rf /var/lib/apt/lists/* # HF Spaces run the container as user 1000 RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH \ PYTHONUNBUFFERED=1 \ HF_HOME=/home/user/.cache/huggingface WORKDIR /home/user/app # CPU-only PyTorch first (the Space has no GPU; avoids ~3 GB of CUDA wheels) RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir torch==2.7.1 torchvision==0.22.1 \ --index-url https://download.pytorch.org/whl/cpu COPY --chown=user requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY --chown=user . . EXPOSE 8501 # --theme.base=light: app/.streamlit/config.toml is not read when running from the repo root CMD ["streamlit", "run", "app/ui.py", \ "--server.port=8501", "--server.address=0.0.0.0", \ "--server.headless=true", "--browser.gatherUsageStats=false", \ "--theme.base=light"]