ec3771f2e7
DATABASE_URL required at startup; schema self-initializes. Compose gains a postgres service for standalone dev. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
45 lines
1.0 KiB
YAML
45 lines
1.0 KiB
YAML
# Local development stack. In production the app is deployed by the
|
|
# infrastructure repo (terraform), which supplies NATS and Kanidm — this
|
|
# compose file only exists for standalone hacking.
|
|
|
|
services:
|
|
app:
|
|
build: .
|
|
env_file: .env
|
|
environment:
|
|
NATS_URL: nats://nats:4222
|
|
DATABASE_URL: postgres://cnats:cnats@postgres:5432/cnats
|
|
ports:
|
|
- "3000:3000"
|
|
depends_on:
|
|
nats:
|
|
condition: service_started
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
nats:
|
|
image: nats:2.10-alpine
|
|
command: ["-js", "-m", "8222"]
|
|
ports:
|
|
- "4222:4222" # client connections
|
|
- "8222:8222" # monitoring UI (http://localhost:8222)
|
|
|
|
postgres:
|
|
image: postgres:17-alpine
|
|
environment:
|
|
POSTGRES_USER: cnats
|
|
POSTGRES_PASSWORD: cnats
|
|
POSTGRES_DB: cnats
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U cnats -d cnats"]
|
|
interval: 2s
|
|
timeout: 3s
|
|
retries: 15
|
|
|
|
volumes:
|
|
pgdata:
|