NexusRAG / Dockerfile
Samyak Chanekar
Claude Sonnet 4.6
fix: pre-bake model+data into Docker image, non-blocking startup
a391d6d
Raw History Blame Contribute Delete
846 Bytes
FROM python:3.11-slim
# System deps for ChromaDB / sentence-transformers
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential gcc \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Python deps first (layer cache)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy source
COPY . .
# Pre-download embedding model (public, no token needed) — bakes into image
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')"
# Pre-ingest all data into ChromaDB — bakes into image, zero startup delay
RUN python ingest_all.py
# HF Spaces injects secrets as env vars — do not bake them in
ENV PYTHONUNBUFFERED=1
EXPOSE 7860
CMD ["python", "-m", "chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]