File size: 1,313 Bytes
dec533d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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"]