-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDOCKERFILE
More file actions
24 lines (17 loc) · 966 Bytes
/
Copy pathDOCKERFILE
File metadata and controls
24 lines (17 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM python:3.12-slim
WORKDIR /app
# Copy requirements and install dependencies
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Pre-download the local embedding + reranker models so the container doesn't fetch them at startup
RUN python -c "from fastembed import TextEmbedding; TextEmbedding('BAAI/bge-small-en-v1.5')" \
&& python -c "from fastembed.rerank.cross_encoder import TextCrossEncoder; TextCrossEncoder('Xenova/ms-marco-MiniLM-L-6-v2')"
# Copy the application code and the pre-built index (docs/ stays out of the
# image — the index already holds the indexed text, raw files aren't needed)
COPY index/ ./index/
COPY app.py retrieval.py check_index.py ./
# Fail the build if the shipped index was built with a different embedding model
RUN python check_index.py
EXPOSE 8000
# Run the server (requires OPENROUTER_API_KEY at runtime)
CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]