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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# pgRDF local-dev compose.
#
# Filename `compose.yml` per the Compose Spec convention; recognised
# automatically by both `docker compose` and `podman compose`.
#
# Stock postgres:17.4-bookworm. No image rebuild, no entrypoint
# wrapper, no init script. The locally-built extension files are
# placed at the canonical Postgres paths via per-file bind mounts.
#
# Why per-file bind mounts and not the INSTALL spec ยง7 GUC path:
# `extension_control_path` arrives in PG 18, and pgrx 0.17+/0.18 do
# not yet build on current rustc (see specs/ERRATA.v0.2.md E-006).
# We pin to PG 17 + pgrx 0.16 until pgrx catches up; bind-mounting
# individual files at $libdir / $sharedir/extension is the spec-
# compliant local incarnation of "drop-in extension files, no image
# rebuild".
#
# Boot sequence:
# 1. just build-ext # builds .so/.control/.sql into ./extensions/
# 2. podman compose up -d # boots Postgres with the bind mounts
# 3. psql ... -c 'CREATE EXTENSION pgrdf;'
services:
postgres:
image: docker.io/library/postgres:17.4-bookworm
container_name: pgrdf-postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-pgrdf}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-pgrdf}
POSTGRES_DB: ${POSTGRES_DB:-pgrdf}
command:
- postgres
- -c
- shared_preload_libraries=pgrdf
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- ./pg-data:/var/lib/postgresql/data:z
# Drop the extension files at canonical PG 17 paths. These bind
# mounts require the files to exist on the host first - produced
# by `just build-ext` (see compose/README.md).
- ./extensions/lib/pgrdf.so:/usr/lib/postgresql/17/lib/pgrdf.so:ro,z
- ./extensions/share/extension/pgrdf.control:/usr/share/postgresql/17/extension/pgrdf.control:ro,z
- ./extensions/share/extension/pgrdf--0.3.0.sql:/usr/share/postgresql/17/extension/pgrdf--0.3.0.sql:ro,z
# Read-only ontology + regression fixtures, reachable from the
# postgres process at /fixtures (see pgrdf.load_turtle path arg).
- ../fixtures:/fixtures:ro,z
healthcheck:
test:
interval: 10s
timeout: 5s
retries: 5