# HF Spaces removed the Streamlit SDK (create_repo now accepts only gradio|docker|static), # so the Space runs as a Docker image that serves the same single Streamlit process. FROM python:3.12-slim # Spaces serve on 7860 and run the container as uid 1000. The app writes at runtime # (embedded Qdrant store, accounts SQLite), so the tree must be owned by that user. RUN useradd -m -u 1000 user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH \ PYTHONUNBUFFERED=1 \ CDMS_OFFLINE_INDEX=1 \ QDRANT_FORCE_LOCAL=1 USER user WORKDIR /app # Dependency layer first so app edits don't reinstall torch/spaCy on every push. COPY --chown=user requirements.txt . RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # App + the prebuilt offline index (data/qdrant_local, data/cdms_metadata.db). COPY --chown=user . . EXPOSE 7860 CMD ["streamlit", "run", "src/streamlit_app_conversational.py", \ "--server.port=7860", \ "--server.address=0.0.0.0", \ "--server.headless=true", \ "--browser.gatherUsageStats=false"]