← 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:
- Local Postgres — with
postgres_fdw,pg_ivm,pg_trgm, andpg_stat_statementspre-installed. Foreign tables mirror your upstream database transparently. - 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
| Variable | Required | Default | Description |
|---|---|---|---|
GOLDLAPEL_UPSTREAM | Yes | — | Upstream Postgres URL (must include credentials) |
GOLDLAPEL_SCHEMAS | No | public | Comma-separated list of schemas to import via FDW |
GOLDLAPEL_PROXY_PORT | No | 7932 | Port the proxy listens on |
POSTGRES_USER | No | postgres | Local Postgres superuser |
POSTGRES_DB | No | postgres | Local 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
| Port | Description |
|---|---|
7932 | Proxy — connect your app here |
7933 | Dashboard — live stats and matview status |
7934 | Invalidation — 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