-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 976 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (24 loc) · 976 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
25
26
27
28
29
30
31
32
# Production backend image — RAG Q&A API
#
# WHY Python 3.12: ChromaDB ships pre-built wheels for 3.12.
# Python 3.14 (host version) lacks ChromaDB wheel support in Docker images.
#
# Build: docker build -t rag-api .
# Run: docker run -p 8001:8001 -v app-data:/app/data rag-api
FROM python:3.12-slim AS base
WORKDIR /app
# System deps for document parsing (pypdf, python-docx, bs4)
RUN apt-get update && \
apt-get install -y --no-install-recommends curl && \
rm -rf /var/lib/apt/lists/*
# Install Python deps first (cached layer unless requirements change)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application source
COPY src/ src/
# Ensure data directory exists
RUN mkdir -p data
EXPOSE 8001
# WHY --workers 1: ChromaDB PersistentClient is single-writer.
# Multiple workers would corrupt the embedded database.
CMD ["uvicorn", "src.api.main:app", "--host", "0.0.0.0", "--port", "8001", "--workers", "1"]