- Custom PostgreSQL 15.2 image with pgvector 0.8.0 extension - Updated pg-cluster-hermes.yaml: custom image, sharedPreloadLibraries, maintenance_work_mem - RAG schema: documents table with vector(768) embeddings + HNSW index - RAG init job: ConfigMap + Job to apply schema to agent_memory db - Embedding service: FastAPI with nomic-embed-text-v1.5 - OpenAI-compatible /v1/embeddings endpoint - Deployment (1 replica, 2Gi-4Gi memory) + Service manifests - Updated kustomization.yaml to include new resources
29 lines
1,018 B
Text
29 lines
1,018 B
Text
# Custom PostgreSQL 15 image with pgvector extension
|
|
# Based on CNPG's official image - must preserve OS user, entrypoint, and PGDATA
|
|
FROM ghcr.io/cloudnative-pg/postgresql:15.2
|
|
|
|
# pgvector version (latest stable as of 2026-05)
|
|
ARG PGVECTOR_VERSION=0.8.0
|
|
|
|
# Install build dependencies for compiling pgvector from source
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
git \
|
|
&& \
|
|
cd /tmp && \
|
|
git clone --branch "v${PGVECTOR_VERSION}" --depth 1 https://github.com/pgvector/pgvector.git && \
|
|
cd pgvector && \
|
|
make && \
|
|
make install && \
|
|
apt-get remove -y build-essential git && \
|
|
apt-get autoremove -y && \
|
|
apt-get clean && \
|
|
rm -rf /var/lib/apt/lists/* /tmp/pgvector
|
|
|
|
# Verify pgvector is installed
|
|
RUN pg_config --version && \
|
|
ls -la /usr/lib/postgresql/*/lib/vector.so
|
|
|
|
# CNPG requirements: same OS user (1000), same entrypoint, same PGDATA
|
|
# The base image already sets these correctly, so no changes needed.
|