Sign inSign up

zyetta/postgres

By zyetta

Updated 3 months ago

PostgreSQL with pgvector, VectorChord, pgvecto.rs, pg_textsearch, and TimescaleDB extensions

Image
0

1.4K

zyetta/postgres repository overview

PostgreSQL with pgvector, VectorChord, pg_textsearch and TimescaleDB

Custom PostgreSQL image with vector search, full-text search and time-series extensions pre-installed.

Base image is pinned to postgres:17-bookworm on purpose. The floating postgres:17 tag has moved to Debian 13 (trixie / gcc 14), which miscompiles pgvector 0.8.0 and segfaults on CREATE EXTENSION vector. bookworm matches the originally-deployed image, so rebuilds stay compatible with existing databases. Re-test pgvector before changing this.

Extensions

ExtensionVersionSchemaPurpose
pgvector0.8.0publicVector similarity search (VectorChord prerequisite)
VectorChord1.1.1publicHigh-performance vector indexing (current Immich extension)
pgvecto.rs0.3.0vectorsLegacy vector search — deprecated, retained only for migrating older Immich databases
pg_textsearch1.3.1publicBM25 full-text search
TimescaleDB2.28.1publicHypertables & time-series

cube and earthdistance ship with PostgreSQL itself (Immich uses them too).

Usage

services:
  postgres:
    image: zyetta/postgres:17
    environment:
      - POSTGRES_USER=myuser
      - POSTGRES_PASSWORD=mypassword
    command:
      - postgres
      - -c
      # vchord.so alone is enough for Immich. Add the rest only if you actually
      # CREATE EXTENSION them.
      - shared_preload_libraries=vchord.so,pg_textsearch,timescaledb

Which extensions need a shared_preload_libraries entry:

ExtensionNeeds preload?Library name
pgvectorno
VectorChordyesvchord.so
pgvecto.rsyesvectors.so
pg_textsearchyespg_textsearch
TimescaleDByestimescaledb

Enabling Extensions

-- Vector search
CREATE EXTENSION vector;
CREATE EXTENSION vchord CASCADE;          -- pulls in vector

-- Full-text search / time-series
CREATE EXTENSION pg_textsearch;           -- requires pg_textsearch preloaded
CREATE EXTENSION timescaledb;             -- requires timescaledb preloaded

-- Legacy pgvecto.rs (deprecated; only to migrate an old Immich database)
CREATE EXTENSION vectors;                 -- requires vectors.so preloaded

Immich

Current/stable Immich runs on VectorChord and needs, in the public schema:

CREATE EXTENSION vchord CASCADE;          -- pulls in vector (pgvector 0.7–0.9; image ships 0.8.0)
CREATE EXTENSION earthdistance CASCADE;   -- pulls in cube

with shared_preload_libraries=vchord.so. PostgreSQL must be >= 14, < 19 (this image is 17). pgvecto.rs (vectors) is deprecated by Immich and only needed to migrate a database that still uses it — it remains installed for that purpose but is not required for new installs.

Tags

  • latest - Latest build
  • 17 - PostgreSQL 17 (what deployments pull)
  • 17-pgvector0.8.0-vchord1.1.1-pgvectors0.3.0-pgts1.3.1-ts2.28.1 - fully pinned versions

Building Locally

docker build -t zyetta/postgres:17 .

Updating Versions

  1. Edit Dockerfile and update the ARG versions (and re-test — see the base image note above before touching FROM)
  2. Commit and push to main
  3. GitHub Actions will build and push automatically

Compatible With

  • Immich - Self-hosted photo management
  • Any application requiring vector similarity, full-text (BM25) or time-series search

Tag summary

Content type

Image

Digest

sha256:395b710c7

Size

425.3 MB

Last updated

3 months ago

docker pull zyetta/postgres