scholar-rag-engine / Dockerfile
snakeeee's picture
cache models for faster startup
678baaf
raw
history blame contribute delete
500 Bytes
FROM python:3.10
WORKDIR /app
COPY . /app
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Pre-download models so they are cached in the image
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')"
RUN python -c "from sentence_transformers import CrossEncoder; CrossEncoder('cross-encoder/ms-marco-MiniLM-L-6-v2')"
EXPOSE 7860
CMD ["uvicorn","main:app","--host","0.0.0.0","--port","7860"]