Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
179 lines (168 loc) · 5.33 KB
/
Copy pathdocker-compose.yml
File metadata and controls
179 lines (168 loc) · 5.33 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# ADAplug stack.
#
# IMPORTANT: this Compose file does NOT boot a cardano-node.
# It attaches to the EXISTING, already-synced CROW node over its
# node-to-client socket (CROW_NODE_SOCKET_PATH). See infra/CROW_NODE_REQUEST.md.
#
# Profiles:
# (default) -> infra only: timescale + redis. `docker compose up`
# spine -> chain followers: db-sync + ogmios + kupo (need CROW socket)
# app -> application containers: api, ingestor, dex-indexer, web
#
# Phase 0 acceptance only needs the default profile (datastores boot).
name: adaplug
services:
# ── Datastore: PostgreSQL 16 + TimescaleDB ────────────────────
timescale:
image: timescale/timescaledb:2.17.2-pg16
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-adaplug}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-adaplug}
POSTGRES_DB: ${POSTGRES_DB:-adaplug}
ports:
- "${POSTGRES_PORT:-55432}:5432"
volumes:
- pgdata:/var/lib/postgresql/data
- ./infra/initdb:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-adaplug}"]
interval: 5s
timeout: 5s
retries: 10
# ── Redis: cache, rate limits, pub/sub, realtime fan-out ──────
redis:
image: redis:7-alpine
restart: unless-stopped
command: ["redis-server", "--appendonly", "yes"]
ports:
- "${REDIS_PORT:-6380}:6379"
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 10
# ── Chain followers (profile: spine) ──────────────────────────
# Attach to the CROW node socket. Bind-mount the socket from the
# node host (co-located) OR relay it in via socat over WireGuard.
ogmios:
image: cardanosolutions/ogmios:v6.11.0
profiles: ["spine"]
restart: unless-stopped
command:
- "--host=0.0.0.0"
- "--node-socket=${CROW_NODE_SOCKET_PATH:-/ipc/node.socket}"
- "--node-config=/config/config.json"
volumes:
- crow_socket:/ipc
- ./infra/cardano-config:/config:ro
ports:
- "1337:1337"
kupo:
image: cardanosolutions/kupo:v2.10.0
profiles: ["spine"]
restart: unless-stopped
command:
- "--node-socket=${CROW_NODE_SOCKET_PATH:-/ipc/node.socket}"
- "--node-config=/config/config.json"
- "--host=0.0.0.0"
- "--workdir=/db"
- "--match=*"
volumes:
- crow_socket:/ipc
- ./infra/cardano-config:/config:ro
- kupodata:/db
ports:
- "1442:1442"
db-sync:
image: ghcr.io/intersectmbo/cardano-db-sync:13.6.0.5
profiles: ["spine"]
restart: unless-stopped
depends_on:
timescale:
condition: service_healthy
environment:
POSTGRES_HOST: timescale
POSTGRES_PORT: 5432
POSTGRES_USER: ${POSTGRES_USER:-adaplug}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-adaplug}
POSTGRES_DB: ${DBSYNC_POSTGRES_DB:-cexplorer}
command:
- "--config=/config/db-sync-config.json"
- "--socket-path=${CROW_NODE_SOCKET_PATH:-/ipc/node.socket}"
volumes:
- crow_socket:/ipc
- ./infra/cardano-config:/config:ro
- dbsyncdata:/var/lib/cdbsync
# ── Application containers (profile: app) ─────────────────────
api:
profiles: ["app"]
build:
context: .
dockerfile: apps/api/Dockerfile
restart: unless-stopped
env_file: .env
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-adaplug}:${POSTGRES_PASSWORD:-adaplug}@timescale:5432/${POSTGRES_DB:-adaplug}
DBSYNC_DATABASE_URL: postgresql://${POSTGRES_USER:-adaplug}:${POSTGRES_PASSWORD:-adaplug}@timescale:5432/${DBSYNC_POSTGRES_DB:-cexplorer}
REDIS_URL: redis://redis:6379
depends_on:
timescale:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "${API_PORT:-4000}:4000"
ingestor:
profiles: ["app"]
build:
context: .
dockerfile: apps/ingestor/Dockerfile
restart: unless-stopped
env_file: .env
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-adaplug}:${POSTGRES_PASSWORD:-adaplug}@timescale:5432/${POSTGRES_DB:-adaplug}
REDIS_URL: redis://redis:6379
depends_on:
timescale:
condition: service_healthy
redis:
condition: service_healthy
dex-indexer:
profiles: ["app"]
build:
context: .
dockerfile: apps/dex-indexer/Dockerfile
restart: unless-stopped
env_file: .env
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-adaplug}:${POSTGRES_PASSWORD:-adaplug}@timescale:5432/${POSTGRES_DB:-adaplug}
REDIS_URL: redis://redis:6379
depends_on:
timescale:
condition: service_healthy
redis:
condition: service_healthy
web:
profiles: ["app"]
build:
context: .
dockerfile: apps/web/Dockerfile
restart: unless-stopped
env_file: .env
environment:
PUBLIC_API_URL: http://api:4000
depends_on:
- api
ports:
- "${WEB_PORT:-3000}:3000"
volumes:
pgdata:
redisdata:
kupodata:
dbsyncdata:
# External socket relayed from the CROW node host. In a co-located
# setup, override this to a bind mount of the real socket directory.
crow_socket: