- Add Nitro plugin to apply Drizzle migrations on server boot (skips when DATABASE_URL is unset, e.g. during build). - Split compose: docker-compose.dev.yml (hot-reload + Postgres) vs docker-compose.yml (production/self-host, env-driven, Coolify-deployable). - Add .dockerignore; parameterise compose env; document the autodeploy decision (Coolify watches main, no CI workflow needed) in ADR 0003 and plan.md T12.
38 lines
820 B
YAML
38 lines
820 B
YAML
# Local development stack: app with hot-reload (source bind-mounted) + Postgres.
|
|
# docker compose -f docker-compose.dev.yml up
|
|
services:
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.dev
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
DATABASE_URL: postgres://andon:andon@db:5432/andon
|
|
HOST: 0.0.0.0
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
volumes:
|
|
- .:/app
|
|
- /app/node_modules
|
|
|
|
db:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_USER: andon
|
|
POSTGRES_PASSWORD: andon
|
|
POSTGRES_DB: andon
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- andon_pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U andon"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
volumes:
|
|
andon_pgdata:
|