Recipes

Supabase

Pin supabase/postgres as store.sql — extension bundle (pgvector, …) without Auth, Storage, Realtime, or Studio.

Supabase publishes supabase/postgres — plain Postgres with a bundled extension set (pgvector, pg_graphql, pg_cron, wrappers, and more). oke docker matches that image ahead of the generic Postgres recipe.

Not the full Supabase platform

This recipe does not start GoTrue, PostgREST, Kong, Realtime, Storage, or Studio. Auth, files, and realtime delivery are already covered by Vault, Store · files, and Signal.

Quick start

Pin the image

oke.config.ts
images: {
  "store.sql": "supabase/postgres:15.8.1.049", // pin a real tag from Supabase's registry
},

Same env shape as Postgres

oke docker injects the same POSTGRES_USER / POSTGRES_PASSWORD / POSTGRES_DB refs from OKE_STORE_SQL_*. Driver id stays postgres.

Use pgvector when you need it

drivers: {
  store: {
    index: { test: "memory", prod: "pgvector" },
  },
},

CREATE EXTENSION IF NOT EXISTS vector runs when the pgvector index driver opens — the extension ships in this image.

Required env

VariableMeaning
OKE_STORE_SQL_USERPOSTGRES_USER
OKE_STORE_SQL_PASSWORDPOSTGRES_PASSWORD
OKE_STORE_SQL_DBPOSTGRES_DB
DATABASE_URLApp connection (postgres://…:5432/…)
PGDATADefault /var/lib/postgresql/data/pgdata

Identical credential contract to Postgres — only the image (and its extension bundle) differs.

Data and backup

PathWhat lives there
$PGDATACluster data, including extension catalogs
Image VOLUME /var/lib/postgresql/dataPersistence mount

Same backup story as plain Postgres: pg_dump or volume backup of /var/lib/postgresql/data. Losing that volume loses tables and which extensions were created.

Production note

Want managed Supabase (Auth / Storage / Realtime included)? Use the Supabase provider and set DATABASE_URL — do not run this image and the cloud project as if they were the same deployment.

For self-hosted production, prefer a pinned tag (not latest) and the same shared-store guidance as Postgres. Free-tier cloud pausing does not apply to this Docker image — you own uptime.

What the recipe configures

FieldValue
Matchsupabase/postgres before generic postgres
Container port5432
Healthcheckpg_isready -U $POSTGRES_USER, every 5s, 10 retries
Connection URLpostgres://user:pass@host:5432/db
PreloadImage config — recipe does not set command

Query performance

Do not overwrite command

supabase/postgres already preloads pg_stat_statements. This recipe leaves command unset so vendor startup stays intact.

StepWhat you do
PreloadImage postgresql.conf (not an oke command)
CreateCREATE EXTENSION IF NOT EXISTS pg_stat_statements
AdvisorCREATE EXTENSION IF NOT EXISTS index_advisor CASCADE when listed

Console Performance then reads engine stats. Enable Index Advisor from the same view when pg_available_extensions lists it.

Troubleshooting

Learn more

Next

On this page