Commit 4567dd1f authored by AGLANPC\aglan's avatar AGLANPC\aglan

AG

parent 762a009e
......@@ -14,33 +14,25 @@ RUN npm run build
# ============================================
FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy backend code
COPY backend/ ./backend/
# Copy built frontend
COPY --from=frontend-build /build/frontend/dist ./frontend/dist
# Pre-download the ChromaDB embedding model so first request is fast
RUN python -c "\
import chromadb; \
c = chromadb.Client(); \
col = c.create_collection('_warmup'); \
col.add(documents=['warmup embedding model'], ids=['0']); \
c.delete_collection('_warmup'); \
print('Embedding model cached.')"
# Warm up the ChromaDB embedding model so first request is fast
# Using a separate script file to avoid all quoting issues
COPY warmup.py /tmp/warmup.py
RUN python /tmp/warmup.py && rm /tmp/warmup.py
# Create persistent data directory
# Create persistent data directories
RUN mkdir -p /data/chromadb /data/uploads
ENV PYTHONUNBUFFERED=1
......
import chromadb
client = chromadb.Client()
col = client.create_collection(name="warmup")
col.add(documents=["warmup embedding model"], ids=["id0"])
client.delete_collection(name="warmup")
print("Embedding model cached.")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment