-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
235 lines (226 loc) · 6.75 KB
/
docker-compose.yml
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
version: "3.9"
services:
# standalone
# prerequisite for: dbsync, wallet-api, ogmios, submit-api
apex-relay:
image: ghcr.io/intersectmbo/cardano-node:8.7.3
environment:
- CARDANO_BLOCK_PRODUCER=false
- CARDANO_CONFIG=/config/configuration.yaml
- CARDANO_TOPOLOGY=/config/topology.json
- CARDANO_DATABASE_PATH=/data/db
- CARDANO_SOCKET_PATH=/ipc/node.socket
- CARDANO_LOG_DIR=/data/node.log
- CARDANO_BIND_ADDR=0.0.0.0
- CARDANO_PORT=7532
command:
- run
volumes:
- node-ipc:/ipc
- node-db:/data/db
- ./genesis:/genesis
- ./config/relay:/config
restart: on-failure
healthcheck:
# Ping the EKG port to see if it responds.
# Assuming if EKG isn't up then the rest of cardano-node isn't either.
test: ["CMD-SHELL", "curl -f 127.0.0.1:12788 || exit 1"]
interval: 60s
timeout: 10s
retries: 5
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
# standalone
# prerequsite for: dbsync, blockfrost
postgres:
image: postgres:14.10-alpine
environment:
- POSTGRES_LOGGING=true
- POSTGRES_DB_FILE=/run/secrets/postgres_db
- POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
- POSTGRES_USER_FILE=/run/secrets/postgres_user
secrets:
- postgres_password
- postgres_user
- postgres_db
ports:
- ${POSTGRES_PORT:-5433}:5432
volumes:
- postgres:/var/lib/postgresql/data
restart: on-failure
healthcheck:
# Use pg_isready to check postgres is running. Substitute different
# user `postgres` if you've setup differently to config/pgpass-mainnet
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
command: ${POSTGRES_ARGS:--c maintenance_work_mem=1GB -c max_parallel_maintenance_workers=4}
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
# requires: apex-relay and postgres
db-sync:
image: ghcr.io/intersectmbo/cardano-db-sync:13.2.0.1
environment:
- DISABLE_LEDGER=${DISABLE_LEDGER:-}
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- RESTORE_SNAPSHOT=${RESTORE_SNAPSHOT:-}
- RESTORE_RECREATE_DB=N
- EXTRA_DB_SYNC_ARGS=--config /config_dbsync/config.json --socket-path /node-ipc/node.socket
depends_on:
postgres:
condition: service_healthy
apex-relay:
condition: service_healthy
secrets:
- postgres_password
- postgres_user
- postgres_db
volumes:
- node-ipc:/node-ipc
- db-sync-data:/var/lib/cexplorer
- ./config/dbsync:/config_dbsync
- ./config/relay:/config
- ./genesis:/genesis
entrypoint: [
"/nix/store/4c3sz8s85sk74vl0h6r9pgqjz838bhg8-entrypoint/bin/entrypoint",
"--config",
"/config_dbsync/config.json",
"--socket-path",
"/node-ipc/node.socket"
]
restart: on-failure
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
# requires: postgres (consequently dbsync to update the data withing the database)
blockfrost:
image: blockfrost/backend-ryo:v1.7.0
environment:
- BLOCKFROST_CONFIG_SERVER_LISTEN_ADDRESS=0.0.0.0
- PGPASSWORD_FILE=/run/secrets/postgres_password
- NODE_ENV=testnet
- BLOCKFROST_CONFIG_SERVER_PORT=3000
- BLOCKFROST_CONFIG_SERVER_DEBUG=true
- BLOCKFROST_CONFIG_SERVER_PROMETHEUS_METRICS=false
- BLOCKFROST_CONFIG_DBSYNC_HOST=postgres
- BLOCKFROST_CONFIG_DBSYNC_USER_FILE=/run/secrets/postgres_user
- BLOCKFROST_CONFIG_DBSYNC_DATABASE_FILE=/run/secrets/postgres_db
- BLOCKFROST_CONFIG_DBSYNC_PORT=5432
- BLOCKFROST_CONFIG_DBSYNC_MAX_CONN=10
- BLOCKFROST_CONFIG_NETWORK=testnet
- BLOCKFROST_CONFIG_TOKEN_REGISTRY_URL=https://tokens.cardano.org
depends_on:
db-sync:
condition: service_started
entrypoint:
- '/nix/store/7q1b1bsmxi91zci6g8714rcljl620y7f-bash-5.2-p15/bin/bash'
- '-c'
- |
export PATH=$$PATH:/nix/store/f11ibsj5vmqcy8ihfa8mzvpfs4af7cw5-coreutils-9.1/bin;
export PGPASSWORD=$$(cat $$PGPASSWORD_FILE);
export BLOCKFROST_CONFIG_DBSYNC_USER=$$(cat $$BLOCKFROST_CONFIG_DBSYNC_USER_FILE);
export BLOCKFROST_CONFIG_DBSYNC_DATABASE=$$(cat $$BLOCKFROST_CONFIG_DBSYNC_DATABASE_FILE);
/nix/store/y52li35j2ldsh5ax4xzq8zdnr3hpb3rc-blockfrost-backend-ryo/bin/blockfrost-backend-ryo
ports:
- ${BLOCKFROST_PORT:-3030}:3000
secrets:
- postgres_password
- postgres_user
- postgres_db
restart: on-failure
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
# requires: apex-relay
wallet-api:
image: cardanofoundation/cardano-wallet:2023.12.18
volumes:
- node-ipc:/ipc
- wallet-api-data:/wallet-db
- ./genesis:/genesis
ports:
- 8190:8090
entrypoint: []
command: bash -c "
([[ $$NETWORK == \"mainnet\" ]] && $$CMD --mainnet) ||
($$CMD --testnet /genesis/byron/genesis.json)
"
environment:
CMD: "cardano-wallet serve --node-socket /ipc/node.socket --database /wallet-db --listen-address 0.0.0.0"
NETWORK:
depends_on:
apex-relay:
condition: service_healthy
restart: on-failure
logging:
driver: "json-file"
options:
compress: "true"
max-file: "10"
max-size: "50m"
# requires: wallet-api
icarus:
image: piotrstachyra/icarus:v2023-04-14
environment:
- ICARUS_PORT=4455
- ICARUS_BIND_ADDR=0.0.0.0
entrypoint: []
command: sh -c "
sed -i 's/8090/8190/g' app.rb && \
sed -i 's/8090/8190/g' views/discovery.erb && \
ruby app.rb
"
network_mode: "host"
restart: on-failure
depends_on:
wallet-api:
condition: service_started
# requires: apex-relay
ogmios:
image: cardanosolutions/ogmios:v6.1.0
restart: on-failure
command: [
"--host", "0.0.0.0",
"--node-socket", "/ipc/node.socket",
"--node-config", "/config/configuration.yaml"
]
volumes:
- node-ipc:/ipc
- ./genesis:/genesis
- ./config/relay:/config
ports:
- ${OGMIOS_PORT:-1377}:1337
depends_on:
apex-relay:
condition: service_healthy
secrets:
# prerequisite for: postgres, dbsync, blockfrost
postgres_db:
file: ./secrets/dbsync/postgres_db
postgres_password:
file: ./secrets/dbsync/postgres_password
postgres_user:
file: ./secrets/dbsync/postgres_user
volumes:
# apex-relay, dbsync, wallet-api, ogmios, submit-api
node-ipc:
# apex-relay
node-db:
# dbsync
db-sync-data:
# postgres
postgres:
# wallet-api
wallet-api-data: