PostgreSQL database server on port 5432 with pgvector extension and persistent data. Entrypoint supports POSTGRES_SHARED_PRELOAD_LIBRARIES for extension loading. Use when working with PostgreSQL, database configuration, or pgvector.
| Property | Value |
|---|---|
| Dependencies | none |
| Ports | 5432 |
| Volumes | pgdata -> ~/.postgresql/data |
| Service | postgresql (supervisord, priority 10) |
| Install files | tasks: |
| Variable | Value |
|---|---|
PGDATA | ~/.postgresql/data |
POSTGRES_HOST_AUTH_METHOD | scram-sha-256 |
POSTGRES_SHARED_PRELOAD_LIBRARIES |
(optional) — comma-separated .so names loaded at startup |
The entrypoint also reads these variables (with defaults, not set in layer.yml):
POSTGRES_USER (default: postgres) — set by consuming layers (e.g., immich sets immich)POSTGRES_DB (default: $POSTGRES_USER) — set by consuming layersPOSTGRES_PASSWORD — required unless POSTGRES_HOST_AUTH_METHOD=trust| Variable | Template Value | Resolved Example |
|---|---|---|
PGHOST | {{.ContainerName}} | ov-postgresql |
PGPORT | 5432 | 5432 |
Pod-aware: same-container consumers receive PGHOST=localhost, cross-container consumers receive PGHOST=ov-postgresql. When ov config runs, these are automatically injected into the global deploy.yml env for PostgreSQL service discovery.
See /ov:layer for env_provides field docs.
postgresql-server (RPM)postgresql-contrib (RPM)pgvector (RPM) -- vector similarity search extension# image.yml -- typically used as dependency of immich
my-image:
layers:
- postgresql
/ov-images:immich/ov-images:immich-mlThe custom entrypoint (/usr/local/bin/postgresql-entrypoint.sh) supports:
initdb, database creation, and /docker-entrypoint-initdb.d/ scriptsPOSTGRES_PASSWORD or POSTGRES_PASSWORD_FILEPOSTGRES_SHARED_PRELOAD_LIBRARIES — when set, adds -c shared_preload_libraries=... to both the init-phase temp server and the final exec. Used by the vectorchord layer to load vchord.so. Generic mechanism — any extension layer can use it./ov-layers:immich -- primary consumer (depends on postgresql)/ov-layers:vectorchord -- sets POSTGRES_SHARED_PRELOAD_LIBRARIES=vchord.so/ov-layers:redis -- often paired with postgresql in service stacks/ov:config — Deploy with secrets provisioning (db-password)/ov:secrets — Manage database credentialsUse when the user asks about:
PGDATA configuration