FROM python:3.10-slim WORKDIR /app # Install system dependencies, git-lfs, and uv RUN apt-get update && apt-get install -y \ build-essential \ curl \ git \ git-lfs \ && rm -rf /var/lib/apt/lists/* \ && git lfs install \ && pip install uv # Copy pyproject.toml and uv.lock for dependency management COPY pyproject.toml uv.lock ./ # Install Python dependencies using uv RUN uv pip install --system . # Copy backend # Copy backend code COPY backend/ ./backend/ # Copy processed documents and vector data # Ensure documents and vectorstore folders exist (even if empty) RUN mkdir -p vectorstore documents # Copy vectorstore folder if it exists in the build context # Note: If vectorstore/ doesn't exist in repo, ensure an empty vectorstore/ folder exists # (create it with: mkdir -p vectorstore && touch vectorstore/.gitkeep) # The vectorstore will be populated at runtime from processed_documents.json if not pre-built # COPY vectorstore/ ./vectorstore/ # Copy documents and processed data COPY documents/ ./documents/ COPY processed_documents.json ./processed_documents.json # Copy built frontend bundle COPY frontend/build/ ./frontend/build/ # Copy main app entry point COPY app.py . # COPY files_upload.py ./files_upload.py # Expose port (Hugging Face Spaces uses 7860) EXPOSE 7860 # Run the application CMD ["python", "app.py"]