CoolFace
Apppublic

Harshavard21/FinRAG

sourceHugging Faceupdated 19d agoView on Hugging Face
2likes
Dockerfile26 linesDownload Raw Back to root
1# Use official Python image2FROM python:3.12-slim3 4# Install system dependencies required for PyTorch and PDFs5RUN apt-get update && apt-get install -y build-essential6 7# Set working directory8WORKDIR /app9 10# Copy requirements and install11COPY requirements.txt .12RUN pip install --no-cache-dir -r requirements.txt13 14# Pre-download massive AI models during the build phase!15# This prevents the 60-second Hugging Face timeout from killing your app when a user asks the first question.16RUN python -c "from sentence_transformers import SentenceTransformer, CrossEncoder; print('Downloading BGE...'); SentenceTransformer('BAAI/bge-large-en-v1.5'); print('Downloading BGE Reranker...'); CrossEncoder('BAAI/bge-reranker-base'); print('Models successfully baked into Docker image!')"17 18# Copy your application code19COPY . .20 21# Expose the port Hugging Face expects (7860)22EXPOSE 786023 24# Run FastAPI on port 786025CMD ["uvicorn", "app.api.server:app", "--host", "0.0.0.0", "--port", "7860"]26