Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ Persistent development/production databases record applied-file checksums. Editi

`DATABASE_URL` directs status/validate/migrate at an explicitly supplied persistent database. Otherwise they use `pgstencil_dev`. Schema/type commands always use a disposable migrated clone. Never point template management at a production cluster.

Local services run PostgreSQL 18. The 18 image keeps its data under `/var/lib/postgresql/18/docker` and refuses a volume holding a 17 cluster, so the volume is named `postgres-18-data` and an existing checkout starts a fresh development database. The old volume stays until removed with `docker volume rm <project>_postgres-data`; `docker volume ls` lists it.

## Resource lifecycle

Each checkout has a Compose project name derived from its absolute path, its own network, and a named Postgres volume. Local credentials and resolved ports are cached in ignored `.pgstencil/services.json`. Both exposed service ports bind to loopback. Change image versions in `compose.yaml`, then stop and restart the services; do not change Postgres major versions against an existing volume without a database upgrade.
Expand Down
6 changes: 3 additions & 3 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
services:
postgres:
image: postgres:17.11-alpine
image: postgres:18.6-alpine
environment:
POSTGRES_USER: pgstencil
POSTGRES_PASSWORD: pgstencil-local-only
POSTGRES_DB: postgres
command: [postgres, -c, max_connections=200]
volumes: [postgres-data:/var/lib/postgresql/data]
volumes: [postgres-18-data:/var/lib/postgresql]
ports: ['127.0.0.1::5432']
healthcheck:
test: [CMD-SHELL, 'pg_isready -U pgstencil -d postgres']
Expand All @@ -27,4 +27,4 @@ services:
condition: service_healthy
ports: ['127.0.0.1::5000']
volumes:
postgres-data:
postgres-18-data:
Loading