438399646f
Consolidate onto PostgreSQL by using pgvector instead of a separate ChromaDB instance. This removes a Docker volume, a large dependency, and simplifies the stack without meaningful performance impact at our document scale. - Swap langchain-chroma for langchain-postgres (PGVector) - Use pgvector/pgvector:pg16 Docker image with init script - Lazy-initialize vector store to avoid eager DB connections - Add SQL helpers for stats/delete/list (replacing _collection access) - Remove legacy main.py, chunker, petmd scraper, and /api/query endpoint Re-index required after deploy (POST /api/rag/index + /index-obsidian). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
53 lines
1.1 KiB
Docker
53 lines
1.1 KiB
Docker
FROM python:3.13-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies, Node.js, uv, and yarn
|
|
RUN apt-get update && apt-get install -y \
|
|
build-essential \
|
|
curl \
|
|
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
|
&& apt-get install -y nodejs \
|
|
&& npm install -g yarn \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
|
|
# Add uv to PATH
|
|
ENV PATH="/root/.local/bin:$PATH"
|
|
|
|
# Copy dependency files
|
|
COPY pyproject.toml ./
|
|
|
|
# Install Python dependencies using uv
|
|
RUN uv pip install --system -e .
|
|
|
|
# Copy frontend package files and install dependencies
|
|
COPY raggr-frontend/package.json raggr-frontend/yarn.lock* raggr-frontend/
|
|
WORKDIR /app/raggr-frontend
|
|
RUN yarn install
|
|
|
|
# Copy application source code
|
|
WORKDIR /app
|
|
COPY . .
|
|
|
|
# Build frontend
|
|
WORKDIR /app/raggr-frontend
|
|
RUN yarn build
|
|
|
|
# Create database directory
|
|
WORKDIR /app
|
|
RUN mkdir -p /app/database
|
|
|
|
# Make startup script executable
|
|
RUN chmod +x /app/startup-dev.sh
|
|
|
|
# Set environment variables
|
|
ENV PYTHONPATH=/app
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
# Expose port
|
|
EXPOSE 8080
|
|
|
|
# Default command
|
|
CMD ["/app/startup-dev.sh"]
|