BeRU Deployer
Deploy BeRU Streamlit RAG System - Add app, models logic, configs, and optimizations for HF Spaces
dec533d | FROM python:3.10-slim | |
| WORKDIR /app | |
| # Install system dependencies (for PDF processing, OCR, etc.) | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| git \ | |
| libpoppler-cpp-dev \ | |
| poppler-utils \ | |
| tesseract-ocr \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements | |
| COPY requirements.txt . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY down.py . | |
| COPY frontend.html . | |
| COPY vlm2rag2.py . | |
| COPY check_user.py . | |
| # include the Streamlit demo as an alternative entrypoint | |
| COPY app.py . | |
| # Create necessary directories | |
| RUN mkdir -p /app/.cache /app/models /app/VLM2Vec-V2rag3 | |
| # Expose HF Spaces default port | |
| EXPOSE 7860 | |
| # by default the image will run the FastAPI server; to start the Streamlit UI | |
| to test locally you can override the command: | |
| # docker run -p7860:7860 <image> streamlit run app.py --server.port=7860 | |
| # Set environment variables | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV HF_HUB_DISABLE_SYMLINKS_WARNING=1 | |
| # default paths used by down.py (can be overridden at runtime) | |
| ENV MODEL_DIR=/app/models | |
| ENV LLM_MODEL_PATH=/app/models/Mistral-7B-Instruct-v0.3 | |
| ENV EMBED_MODEL_PATH=/app/models/VLM2Vec-Qwen2VL-2B | |
| ENV FAISS_INDEX_PATH=/app/VLM2Vec-V2rag3 | |
| # Run FastAPI app on port 7860 | |
| CMD ["python", "down.py", "--port", "7860"] | |