A production-shaped, laptop-friendly PostgreSQL development environment. Foreign Data Wrappers + vector search + scheduling + partitioning + auditing β all pre-installed, tuned to coexist peacefully with Elasticsearch, Redis and NestJS.
- PostgreSQL 17 on the official Debian image, fully reproducible.
- 15+ extensions ready to use the moment the container is up β including
postgres_fdw,mysql_fdw,tds_fdw,file_fdw,pgvector,pg_cron,pg_partman,pg_stat_statements,pgaudit,pg_repack,hypopg,pg_hint_plan,orafce, and the usualuuid-ossp/pgcrypto/pg_trgmtoolbox. - Laptop-safe by design β hard Docker memory & CPU caps so Postgres can never starve your other heavy services.
- One-command workflow via
make(up, down, psql, backup, restore, statsβ¦). - Documented end-to-end β a checklist you can tick off from requirements all the way to deployment.
# 1. Configure (edit the password!)
cp .env.example .env
# 2. Build the image (first build compiles mysql_fdw β grab a coffee β)
make build
# 3. Start
make up
# 4. Verify extensions are live
make extensionsThen connect:
postgresql://local_dev:<your-password>@127.0.0.1:15409/local_db
Host port 15409 mirrors the original reference connection string; the generic
local_dev/local_dbnames keep this reusable. Change anything in.env.
Each document is a self-contained checklist. Tick the boxes as you go.
| # | Document | What it covers |
|---|---|---|
| 0 | Getting Started | π New here? Start with this β friendly step-by-step walkthrough |
| 1 | Requirements | Hardware/software prerequisites, your laptop's budget |
| 2 | Installation | Step-by-step from clone to running container |
| 3 | Configuration | Every .env & postgresql.conf knob explained |
| 4 | Extensions | What each extension does + usage snippets |
| 5 | Resource Tuning | Why the limits are what they are; how to rebalance |
| 6 | NestJS Integration | Wiring this DB into a NestJS/TypeORM/Prisma app |
| 7 | Backup & Restore | Dump, restore, and scheduled backups |
| 8 | Deployment | Promoting the same setup toward staging/prod |
| 9 | Troubleshooting | Common errors and fixes |
| 10 | Security | Hardening checklist for dev and beyond |
| 11 | Import from Source | Safely migrate data from an existing PostgreSQL |
| 12 | Optional Features | Opt-in pooler / backups / UI / metrics β zero cost when off |
postgresql-fdw/
βββ docker-compose.yml # the stack + hard resource caps
βββ Dockerfile # PG17 + extensions (compiles mysql_fdw)
βββ .env.example # copy to .env and edit
βββ Makefile # make up / down / psql / backup ...
βββ config/
β βββ postgresql.conf # laptop-tuned server config
βββ scripts/
β βββ init/ # auto-run on first boot
β β βββ 00-extensions.sql # CREATE EXTENSION for everything
β β βββ 01-roles-and-grants.sql
β βββ fdw-examples/ # copy-paste FDW recipes (not auto-run)
βββ backups/ # pg_dump output lands here
βββ docs/ # the numbered guides above
A bird's-eye view. Detailed steps live in the linked docs.
- Requirements met β Docker Engine + Compose v2, β₯2 GB free RAM budget β doc 1
-
.envcreated and password changed β doc 2 - Image built (
make build) β doc 2 - Container healthy (
make health) β doc 2 - Extensions verified (
make extensions) β doc 4 - Resource caps reviewed for your machine β doc 5
- App connected (NestJS) β doc 6
- Backup tested at least once β doc 7
- Security checklist reviewed β doc 10
A plain make up starts only PostgreSQL. Everything else is opt-in via
Docker Compose profiles, each hard-capped so it never slows your laptop:
make up-pooler # + PgBouncer connection pooler (port 6432)
make up-backup # + scheduled rotated backups
make up-ui # + Adminer web UI (http://localhost:8080)
make up-metrics # + postgres-exporter (http://localhost:9187)
make up-all # + everything aboveFull matrix & tuning: doc 12 β Optional Features.
make up # start ONLY core Postgres
make down # stop everything (data kept)
make psql # open a psql shell
make extensions # list installed extensions
make stats # live CPU/RAM of the container
make backup # one-off dump to ./backups (manual)
make logs # follow logs
make destroy # stop AND delete data (careful!)
make help # everythingprogrammerShinobi Β· GitHub
If this project helps you, a β on the repo is appreciated!
Copyright Β© 2026 programmerShinobi. Released under the MIT License.