1
1
version : ' 3.9'
2
2
3
+ x-from-sdk : &from-sdk
4
+ healthcheck :
5
+ interval : 10s
6
+ timeout : 5s
7
+ retries : 10
8
+ restart : on-failure
9
+
3
10
x-logging : &logging
4
11
logging :
5
12
driver : ' json-file'
6
13
options :
7
14
max-size : ' 400k'
8
15
max-file : ' 20'
9
16
17
+ x-provider-server : &provider-server
18
+ build :
19
+ args :
20
+ - NETWORK=${NETWORK:-mainnet}
21
+ context : ../../
22
+ target : provider-server
23
+ depends_on :
24
+ cardano-db-sync :
25
+ condition : service_healthy
26
+ environment :
27
+ API_URL : http://0.0.0.0:3000
28
+ DB_CACHE_TTL : ${DB_CACHE_TTL:-120}
29
+ DISABLE_DB_CACHE : ${DISABLE_DB_CACHE:-false}
30
+ DISABLE_STAKE_POOL_METRIC_APY : ${DISABLE_STAKE_POOL_METRIC_APY:-false}
31
+ ENABLE_METRICS : ${ENABLE_METRICS:-false}
32
+ EPOCH_POLL_INTERVAL : ${EPOCH_POLL_INTERVAL:-500}
33
+ SERVICE_NAMES : ${SERVICE_NAMES:-asset,chain-history,network-info,rewards,stake-pool,tx-submit,utxo}
34
+ USE_BLOCKFROST : ${USE_BLOCKFROST:-false}
35
+ USE_QUEUE : ${USE_QUEUE:-false}
36
+
37
+ x-with-postgres : &with-postgres
38
+ depends_on :
39
+ postgres :
40
+ condition : service_healthy
41
+ secrets :
42
+ - postgres_password
43
+ - postgres_user
44
+ - postgres_db
45
+ - postgres_db_db_sync
46
+ - postgres_db_stake_pool
47
+
48
+ x-provider-server-environment : &provider-server-environment
49
+ API_URL : http://0.0.0.0:3000
50
+ DB_CACHE_TTL : ${DB_CACHE_TTL:-120}
51
+ DISABLE_DB_CACHE : ${DISABLE_DB_CACHE:-false}
52
+ DISABLE_STAKE_POOL_METRIC_APY : ${DISABLE_STAKE_POOL_METRIC_APY:-false}
53
+ ENABLE_METRICS : ${ENABLE_METRICS:-false}
54
+ EPOCH_POLL_INTERVAL : ${EPOCH_POLL_INTERVAL:-500}
55
+ SERVICE_NAMES : ${SERVICE_NAMES:-asset,chain-history,network-info,rewards,stake-pool,tx-submit,utxo}
56
+ USE_BLOCKFROST : ${USE_BLOCKFROST:-false}
57
+ USE_QUEUE : ${USE_QUEUE:-false}
58
+
59
+ x-sdk-environment : &sdk-environment
60
+ LOGGER_MIN_SEVERITY : ${LOGGER_MIN_SEVERITY:-info}
61
+ OGMIOS_URL : ws://cardano-node-ogmios:1337
62
+ POSTGRES_DB_FILE_DB_SYNC : /run/secrets/postgres_db_db_sync
63
+ POSTGRES_DB_FILE_STAKE_POOL : /run/secrets/postgres_db_stake_pool
64
+ POSTGRES_HOST_DB_SYNC : postgres
65
+ POSTGRES_HOST_STAKE_POOL : postgres
66
+ POSTGRES_POOL_MAX_DB_SYNC : ${POSTGRES_POOL_MAX:-10}
67
+ POSTGRES_POOL_MAX_STAKE_POOL : ${POSTGRES_POOL_MAX:-10}
68
+ POSTGRES_PASSWORD_FILE_DB_SYNC : /run/secrets/postgres_password
69
+ POSTGRES_PASSWORD_FILE_STAKE_POOL : /run/secrets/postgres_password
70
+ POSTGRES_PORT_DB_SYNC : 5432
71
+ POSTGRES_PORT_STAKE_POOL : 5432
72
+ POSTGRES_USER_FILE_DB_SYNC : /run/secrets/postgres_user
73
+ POSTGRES_USER_FILE_STAKE_POOL : /run/secrets/postgres_user
74
+ RABBITMQ_URL : amqp://rabbitmq:5672
75
+
10
76
services :
11
77
cardano-db-sync :
12
- << : *logging
78
+ << :
79
+ - *logging
80
+ - *with-postgres
13
81
command : ['--config', '/config/cardano-db-sync/config.json', '--socket-path', '/node-ipc/node.socket']
14
82
environment :
15
- - POSTGRES_HOST= postgres
16
- - POSTGRES_PORT= 5432
17
- - RESTORE_SNAPSHOT= ${RESTORE_SNAPSHOT:-}
18
- - RESTORE_RECREATE_DB= N
83
+ POSTGRES_HOST : postgres
84
+ POSTGRES_PORT : 5432
85
+ RESTORE_SNAPSHOT : ${RESTORE_SNAPSHOT:-}
86
+ RESTORE_RECREATE_DB : N
19
87
depends_on :
20
88
cardano-node-ogmios :
21
89
condition : service_healthy
22
- postgres :
23
- condition : service_healthy
24
90
healthcheck :
25
91
test : ['CMD', '/scripts/is-db-synced.sh']
26
92
interval : 5s
@@ -29,10 +95,6 @@ services:
29
95
start_period : 100ms
30
96
image : inputoutput/cardano-db-sync:${CARDANO_DB_SYNC_VERSION:-13.1.0.0}
31
97
restart : on-failure
32
- secrets :
33
- - postgres_password
34
- - postgres_user
35
- - postgres_db
36
98
stop_signal : SIGINT
37
99
volumes :
38
100
- db-sync-data:/var/lib/cexplorer
@@ -51,39 +113,34 @@ services:
51
113
- node-ipc:/ipc
52
114
53
115
pg-boss-worker :
54
- << : *logging
116
+ << :
117
+ - *from-sdk
118
+ - *logging
119
+ - *with-postgres
55
120
build :
56
121
context : ../../
57
122
target : pg-boss-worker
58
123
depends_on :
59
124
projector :
60
125
condition : service_healthy
61
126
environment :
62
- - LOGGER_MIN_SEVERITY=${LOGGER_MIN_SEVERITY:-info}
63
- - QUEUES=${QUEUES:-pool-metadata,pool-metrics}
64
- - STAKE_POOL_PROVIDER_URL=http://provider-server:3000/stake-pool
127
+ << : *sdk-environment
128
+ API_URL : http://0.0.0.0:3003
129
+ QUEUES : ${QUEUES:-pool-metadata,pool-metrics}
130
+ STAKE_POOL_PROVIDER_URL : http://provider-server:3000/stake-pool
65
131
healthcheck :
66
132
test : ['CMD-SHELL', 'curl -s --fail http://localhost:3003/health']
67
- interval : 10s
68
- timeout : 5s
69
- retries : 10
70
133
ports :
71
134
- ${PG_BOSS_PORT:-4003}:3003
72
- restart : on-failure
73
- secrets :
74
- - postgres_db_db_sync
75
- - postgres_db_stake_pool
76
- - postgres_password
77
- - postgres_user
78
135
79
136
postgres :
80
137
<< : *logging
81
138
command : postgres -c shared_preload_libraries=pg_stat_statements -c pg_stat_statements.track=all
82
139
environment :
83
- - POSTGRES_LOGGING= true
84
- - POSTGRES_DB_FILE= /run/secrets/postgres_db_db_sync
85
- - POSTGRES_PASSWORD_FILE= /run/secrets/postgres_password
86
- - POSTGRES_USER_FILE= /run/secrets/postgres_user
140
+ POSTGRES_LOGGING : true
141
+ POSTGRES_DB_FILE : /run/secrets/postgres_db_db_sync
142
+ POSTGRES_PASSWORD_FILE : /run/secrets/postgres_password
143
+ POSTGRES_USER_FILE : /run/secrets/postgres_user
87
144
image : postgres:${POSTGRES_VERSION:-11.5-alpine}
88
145
healthcheck :
89
146
test : ['CMD-SHELL', 'pg_isready -U postgres']
@@ -100,65 +157,55 @@ services:
100
157
shm_size : ' 2gb'
101
158
102
159
projector :
103
- << : *logging
160
+ << :
161
+ - *from-sdk
162
+ - *logging
163
+ - *with-postgres
104
164
build :
105
165
context : ../../
106
166
target : projector
107
167
depends_on :
108
- postgres :
109
- condition : service_healthy
110
168
cardano-node-ogmios :
111
169
condition : service_healthy
112
170
environment :
113
- - DROP_SCHEMA=${DROP_PROJECTOR_SCHEMA:-false}
114
- - LOGGER_MIN_SEVERITY=${LOGGER_MIN_SEVERITY:-info}
115
- - OGMIOS_URL=ws://cardano-node-ogmios:1337
116
- - PROJECTION_NAMES= ${PROJECTION_NAMES:-stake-pool,stake-pool-metadata-job,stake-pool-metrics-job,utxo}
117
- - SYNCHRONIZE= ${SYNCHRONIZE:-true}
171
+ << : *sdk-environment
172
+ API_URL : http://0.0.0.0:3002
173
+ DROP_SCHEMA : ${DROP_PROJECTOR_SCHEMA:-false}
174
+ PROJECTION_NAMES : ${PROJECTION_NAMES:-stake-pool,stake-pool-metadata-job,stake-pool-metrics-job,utxo}
175
+ SYNCHRONIZE : ${SYNCHRONIZE:-true}
118
176
healthcheck :
119
177
test :
120
178
['CMD-SHELL', 'test `curl -fs http://localhost:3002/health | jq -r ".services[0].projectedTip.blockNo"` -gt 1']
121
- interval : 10s
122
- timeout : 5s
123
- retries : 10
124
179
ports :
125
180
- ${PROJECTOR_PORT:-4002}:3002
126
- restart : on-failure
127
- secrets :
128
- - postgres_db_stake_pool
129
- - postgres_password
130
- - postgres_user
131
181
132
182
provider-server :
133
- << : *logging
134
- build :
135
- args :
136
- - NETWORK=${NETWORK:-mainnet}
137
- context : ../../
138
- target : provider-server
139
- depends_on :
140
- cardano-db-sync :
141
- condition : service_healthy
183
+ << :
184
+ - *from-sdk
185
+ - *logging
186
+ - *provider-server
187
+ - *with-postgres
142
188
environment :
143
- - DB_CACHE_TTL=${DB_CACHE_TTL:-120}
144
- - DISABLE_DB_CACHE=${DISABLE_DB_CACHE:-false}
145
- - DISABLE_STAKE_POOL_METRIC_APY=${DISABLE_STAKE_POOL_METRIC_APY:-false}
146
- - ENABLE_METRICS=${ENABLE_METRICS:-false}
147
- - EPOCH_POLL_INTERVAL=${EPOCH_POLL_INTERVAL:-500}
148
- - LOGGER_MIN_SEVERITY=${LOGGER_MIN_SEVERITY:-info}
149
- - OGMIOS_URL=ws://cardano-node-ogmios:1337
150
- - POSTGRES_POOL_MAX_DB_SYNC=${POSTGRES_POOL_MAX:-10}
151
- - RABBITMQ_URL=amqp://rabbitmq:5672
152
- - SERVICE_NAMES=${SERVICE_NAMES:-asset,chain-history,network-info,rewards,stake-pool,tx-submit,utxo}
153
- - USE_BLOCKFROST=${USE_BLOCKFROST:-false}
154
- - USE_QUEUE=${USE_QUEUE:-false}
189
+ << :
190
+ - *sdk-environment
191
+ - *provider-server-environment
155
192
ports :
156
193
- ${API_PORT:-4000}:3000
157
- restart : on-failure
158
- secrets :
159
- - postgres_db_db_sync
160
- - postgres_password
161
- - postgres_user
194
+
195
+ stake-pool-provider-server :
196
+ << :
197
+ - *from-sdk
198
+ - *logging
199
+ - *provider-server
200
+ - *with-postgres
201
+ environment :
202
+ << :
203
+ - *sdk-environment
204
+ - *provider-server-environment
205
+ SERVICE_NAMES : stake-pool
206
+ USE_TYPEORM_STAKE_POOL_PROVIDER : true
207
+ ports :
208
+ - ${STAKE_POOL_API_PORT:-4010}:3000
162
209
163
210
rabbitmq :
164
211
<< : *logging
@@ -176,6 +223,9 @@ services:
176
223
- rabbitmq-db:/var/lib/rabbitmq/mnesia
177
224
178
225
worker :
226
+ << :
227
+ - *from-sdk
228
+ - *logging
179
229
build :
180
230
context : ../../
181
231
target : worker
@@ -185,12 +235,10 @@ services:
185
235
rabbitmq :
186
236
condition : service_healthy
187
237
environment :
188
- - LOGGER_MIN_SEVERITY=${LOGGER_MIN_SEVERITY:-info}
189
- - OGMIOS_URL=ws://cardano-node-ogmios:1337
190
- - PARALLEL=${PARALLEL:-false}
191
- - PARALLEL_TX=${PARALLEL_TX:-3}
192
- - POLLING_CYCLE=${POLLING_CYCLE:-500}
193
- - RABBITMQ_URL=amqp://rabbitmq:5672
238
+ << : *sdk-environment
239
+ PARALLEL : ${PARALLEL:-false}
240
+ PARALLEL_TX : ${PARALLEL_TX:-3}
241
+ POLLING_CYCLE : ${POLLING_CYCLE:-500}
194
242
restart : on-failure
195
243
196
244
secrets :
0 commit comments