Skip to content

Increment 1 - Step 3: Docker Compose Postgres - #3

Merged
angelobarbu merged 1 commit into
increment-1from
increment-1-step-3
Aug 7, 2026
Merged

Increment 1 - Step 3: Docker Compose Postgres#3
angelobarbu merged 1 commit into
increment-1from
increment-1-step-3

Conversation

@angelobarbu

Copy link
Copy Markdown
Owner

docker/docker-compose.yml — postgres:16-alpine (pulled 16.14), project name modulo, container modulo-postgres, named volume modulo_pgdata, and a pg_isready healthcheck so up --wait blocks until the DB actually accepts connections. Two deliberate security/ergonomics details: the host port binds to 127.0.0.1:5433 only and ./initdb mounts read-only into the image's entrypoint directory.

docker/initdb/01_create_test_db.sql — creates modulo_test for integration tests; runs once on first initialization of an empty volume.

scripts/db-up.sh — starts and waits for healthy, with a clear error if Docker isn't running.

scripts/db-down.sh — stops preserving data by default; --wipe deletes the volume behind an explicit y/N confirmation prompt.

@angelobarbu
angelobarbu merged commit ecae261 into increment-1 Aug 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant