dorfteich/deploy/compose/compose.dev.yml
Claude Fable 5 ca0f7cf4b1 Add Prisma with PostgreSQL, automatic migrations, and /readyz
apps/api gains Prisma (instance_settings as the first model) with the
initial migration applied automatically at startup via prisma migrate
deploy, a lazy-connecting PrismaService, and GET /api/v1/readyz
reporting named checks (database reachable, migrations applied) with
200/503. DATABASE_URL joins the validated environment schema;
MIGRATE_ON_START=false skips deploys for tests and tooling. An
idempotent seed script and a Compose dev overlay with PostgreSQL
(host port 5434 — 5433 is taken locally) complete the loop.

Closes #3

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 19:16:44 +02:00

29 lines
913 B
YAML

# Local development overlay. For now this only provides the database;
# issue #6 extends it with hot-reloading web/api services layered over the
# production docker-compose.yml.
#
# Usage (from the repo root):
# docker compose -f deploy/compose/compose.dev.yml up -d db
# DATABASE_URL=postgresql://dorfteich:dorfteich@localhost:5434/dorfteich pnpm --filter @dorfteich/api start:dev
services:
db:
image: postgres:17.5-alpine
environment:
POSTGRES_USER: dorfteich
POSTGRES_PASSWORD: dorfteich
POSTGRES_DB: dorfteich
ports:
# 5434 on the host to avoid colliding with other local PostgreSQL instances (5432 system, 5433 wochenplan-staging).
- '5434:5432'
volumes:
- db-data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U dorfteich -d dorfteich']
interval: 5s
timeout: 3s
retries: 10
volumes:
db-data: