← Docs

Docker

Pre-configured with all extensions. Point it at your database and it handles the rest.

Quick start

docker pull goldlapel/goldlapel
docker run -d \
  -e GOLDLAPEL_UPSTREAM='postgres://user:pass@your-db-host:5432/mydb' \
  -p 7932:7932 \
  goldlapel/goldlapel

Connect your app to localhost:7932 instead of your database. Gold Lapel observes your queries, creates materialized views and indexes, and rewrites reads to use them — automatically.

How it works

The container runs two processes:

  1. Local Postgres — with postgres_fdw, pg_ivm, pg_trgm, and pg_stat_statements pre-installed. Foreign tables mirror your upstream database transparently.
  2. Gold Lapel proxy — listens on port 7932, observes query patterns, creates materialized views and indexes on the local Postgres, and rewrites reads to use them.

Writes pass through to your upstream database untouched. Reads hit local materialized views when available — local I/O, no round-trip to upstream.

Environment variables

VariableRequiredDefaultDescription
GOLDLAPEL_UPSTREAMYesUpstream Postgres URL (must include credentials)
GOLDLAPEL_SCHEMASNopublicComma-separated list of schemas to import via FDW
GOLDLAPEL_PROXY_PORTNo7932Port the proxy listens on
POSTGRES_USERNopostgresLocal Postgres superuser
POSTGRES_DBNopostgresLocal Postgres database name

All Gold Lapel config flags work as environment variables with the GOLDLAPEL_ prefix (e.g. GOLDLAPEL_MODE=waiter, GOLDLAPEL_POOL_SIZE=30). The configuration reference has the full list.

Ports

PortDescription
7932Proxy — connect your app here
7933Dashboard — live stats and matview status
7934Invalidation — keeps L1 native cache current (managed automatically)

Examples

Docker Compose

docker-compose.yml
services:
  goldlapel:
    image: goldlapel/goldlapel
    ports:
      - "7932:7932"
      - "7933:7933"
      - "7934:7934"
    environment:
      GOLDLAPEL_UPSTREAM: postgres://user:pass@db:5432/mydb
      GOLDLAPEL_MODE: waiter

With sslmode

docker run -d \
  -e GOLDLAPEL_UPSTREAM='postgres://user:pass@host:5432/mydb?sslmode=require' \
  -p 7932:7932 \
  goldlapel/goldlapel

Multiple schemas

Import foreign tables from multiple upstream schemas:

docker run -d \
  -e GOLDLAPEL_UPSTREAM='postgres://user:pass@host:5432/mydb' \
  -e GOLDLAPEL_SCHEMAS=public,sales,analytics \
  -p 7932:7932 \
  goldlapel/goldlapel

Platforms

Multi-arch image: linux/amd64 and linux/arm64.

Known limitations

  • Matviews rebuilt on restart — container restart drops and recreates foreign tables (CASCADE), which drops dependent matviews. Gold Lapel rebuilds them from persisted pattern stats, but there's a warm-up period. This is a Postgres limitation (foreign table dependencies), not a data loss issue.

Next steps

  • Commands — subcommands, connection modes, TLS, replicas, failover