Repository navigation
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
86 lines (79 loc) · 3.49 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
86 lines (79 loc) · 3.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# =============================================================================
# docker-compose.dev.yml — Odal Node local infrastructure
# Usage: docker compose -f docker/docker-compose.dev.yml up -d
# or: just infra
# =============================================================================
# Runs infrastructure dependencies only. Rust services run via `cargo run`
# (or `just vault` / `just identity` / `just resolver`).
#
# Build node with: cargo run -p dpp-node --features postgres
# Env: copy .env.example → .env (PostgreSQL vars; DATABASE_URL = app role)
# =============================================================================
name: odal-node-dev
services:
# ---------------------------------------------------------------------------
# PostgreSQL — primary datastore
# App connects as odal_app (least-privilege, no DDL — the node refuses to boot
# as a superuser); migrations run as the postgres superuser.
# [verify] pin to the current 17.x digest before any deploy beyond dev.
# ---------------------------------------------------------------------------
postgres:
image: postgres:17
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: dev_only_password
POSTGRES_DB: odal
# The init script reads this to provision the odal_app role. Dev uses a
# well-known value; prod requires a real secret (see docker-compose.yml).
DATABASE_APP_PASS: dev_only_password
ports:
- "5432:5432"
volumes:
- pg-data:/var/lib/postgresql/data
# Provision the odal_app role from DATABASE_APP_PASS once at first init.
# Hook + SQL live in ops/bootstrap/ (single source of truth with the
# managed `just db-bootstrap` path); paths are relative to docker/.
- ../ops/bootstrap/pg-init.sh:/docker-entrypoint-initdb.d/10-roles.sh:ro
- ../ops/bootstrap/bootstrap.sql:/opt/odal/bootstrap.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d odal"]
interval: 5s
timeout: 3s
retries: 10
start_period: 5s
# ---------------------------------------------------------------------------
# Redis — resolver response cache
# ---------------------------------------------------------------------------
redis:
image: redis:7-alpine
command: redis-server --save "" --appendonly no
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
# ---------------------------------------------------------------------------
# NATS JetStream — event bus (used in Phase 2)
# ---------------------------------------------------------------------------
nats:
image: nats:2-alpine
command: ["-js", "-m", "8222"]
ports:
- "4222:4222" # client
- "8222:8222" # monitoring
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8222/healthz"]
interval: 5s
timeout: 3s
retries: 10
# =============================================================================
# Vault environment reference (run via `cargo run -p dpp-node --features postgres`)
# =============================================================================
# DATABASE_URL=postgres://odal_app:dev_only_password@localhost:5432/odal
# DATABASE_MIGRATE_URL=postgres://postgres:dev_only_password@localhost:5432/odal
# CORS_ALLOWED_ORIGINS=https://app.odal-node.io,http://localhost:3000
# Set to empty (default) to disable CORS for server-side API-key access only.
volumes:
pg-data: