FROM python:3.11-slim WORKDIR /code COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . # Build the retrieval index at image build time so the Space starts warm. # This also runs the Dimensioning Agent per image (metric depth model), which # is the slow part. Limit kept small (100) to fit inside free-tier Space # build timeouts — raise it once you've confirmed a build succeeds, or move # this to a runtime/first-request build if you want the full 500 immediately. RUN python -m app.data.ingest --limit 100 # Hugging Face Spaces expects the app to listen on port 7860. EXPOSE 7860 CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]