Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
79 lines (75 loc) · 1.97 KB
/
Copy pathdocker-compose.yml
File metadata and controls
79 lines (75 loc) · 1.97 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
services:
# PostgreSQL Database
#
# Schema migrations are applied at engine startup by the embedded
# migrator (internal/infrastructure/persistence/postgres/migrator.go),
# NOT by docker-entrypoint-initdb.d. The image only needs the
# POSTGRES_* envs to bootstrap an empty cluster + default DB; the
# engine takes over from there.
db:
image: postgres:15
container_name: duragraph-postgres
environment:
POSTGRES_USER: appuser
POSTGRES_PASSWORD: apppass
POSTGRES_DB: appdb
ports:
- "${DURAGRAPH_DB_PORT:-5433}:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U appuser -d appdb"]
interval: 30s
timeout: 10s
retries: 5
# NATS JetStream
nats:
image: nats:2.10-alpine
container_name: duragraph-nats
command: "-js -sd /data -m 8222"
ports:
- "${DURAGRAPH_NATS_PORT:-4223}:4222" # Client connections
- "${DURAGRAPH_NATS_MGMT_PORT:-8223}:8222" # HTTP management
volumes:
- natsdata:/data
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8222/healthz"]
interval: 10s
timeout: 5s
retries: 3
# API Server
server:
build:
context: .
dockerfile: deploy/docker/Dockerfile.server
container_name: duragraph-server
ports:
- "8081:8080"
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_USER=appuser
- DB_PASSWORD=apppass
- DB_NAME=appdb
- DB_SSLMODE=disable
- NATS_URL=nats://nats:4222
- PORT=8080
- HOST=0.0.0.0
depends_on:
db:
condition: service_healthy
nats:
condition: service_healthy
restart: unless-stopped
# Dashboard (development)
dashboard:
build:
context: dashboard
dockerfile: ../deploy/docker/Dockerfile.dashboard
container_name: duragraph-dashboard
ports:
- "5173:80"
restart: unless-stopped
volumes:
pgdata:
natsdata: