maxime.killinger dcf4169d3d
🚀 Docker Build and Push / build-and-push (16) (push) Successful in 16m11s
🚀 Docker Build and Push / build-and-push (15) (push) Successful in 16m26s
🚀 Docker Build and Push / build-and-push (17) (push) Successful in 11m7s
feat(docker): add PostGIS and remove unstable PG18 support
- Install PostGIS (postgresql--postgis-3) in the final image.

- Add postgis and postgis_topology to init-extensions.sh.

- Add test script for PostGIS to the CI workflow.

- Update README.md to reflect PostGIS integration.

- Remove PG18 from CI matrix because of ABI incompatibility between TimescaleDB headers and the vchord-postgres PG18 runtime (missing palloc0_mul). PG18 support will be restored when VectorChord releases a stable PG18 image.
2026-08-03 18:14:08 +02:00

TimescaleDB + VectorChord + pgvector + PostGIS

Build Status

Docker image combining PostgreSQL with four powerful extensions:

  • TimescaleDB - Time-series database extension
  • VectorChord - High-performance vector similarity search
  • pgvector - Open-source vector similarity search
  • PostGIS - Geographic objects support

Supported PostgreSQL Versions

Tag PostgreSQL TimescaleDB VectorChord pgvector PostGIS
pg15 15 2.28.3 1.1.1 0.8.1 3.x
pg16 16 2.28.3 1.1.1 0.8.1 3.x
pg17, latest 17 2.28.3 1.1.1 0.8.1 3.x

Quick Start

docker run -d \
  --name my-postgres \
  -e POSTGRES_PASSWORD=mysecretpassword \
  -v postgres_data:/var/lib/postgresql \
  -p 5432:5432 \
  gitea.killinger.fr/maxime.killinger/postgres-ts-vectors:latest

All extensions are automatically created on first startup.

Data Persistence

Important

Starting with PostgreSQL 18, mount volumes at /var/lib/postgresql (not /var/lib/postgresql/data). Data will be stored in a versioned subdirectory (e.g., /var/lib/postgresql/18/main), which facilitates future upgrades with pg_upgrade.

Environment Variables

Variable Description Default
POSTGRES_PASSWORD PostgreSQL password (required) -
POSTGRES_USER PostgreSQL user postgres
POSTGRES_DB Default database postgres

Extensions Usage

TimescaleDB

-- Create a hypertable
CREATE TABLE conditions (
  time TIMESTAMPTZ NOT NULL,
  device_id INTEGER,
  temperature DOUBLE PRECISION
);

SELECT create_hypertable('conditions', 'time');

VectorChord / pgvector

-- Create a table with vector embeddings
CREATE TABLE documents (
  id SERIAL PRIMARY KEY,
  content TEXT,
  embedding vector(1536)
);

-- Create an index for fast similarity search
CREATE INDEX ON documents USING vchordrq (embedding vector_l2_ops);

-- Query similar documents
SELECT * FROM documents
ORDER BY embedding <-> '[0.1, 0.2, ...]'
LIMIT 10;

Building Locally

# Build for PG18
docker build --build-arg PG_VERSION=18 -t my-image:pg18 .

# Build for PG16
docker build --build-arg PG_VERSION=16 -t my-image:pg16 .

License

This project is licensed under the Apache 2.0 License.

S
Description
No description provided
Readme
58 KiB
Languages
Dockerfile 66.3%
Shell 33.7%