-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdocker-compose.yml
208 lines (198 loc) · 11.2 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
version: "3.8"
services:
fullnode:
image: "radixdlt/babylon-node:v1.3.0"
profiles: ["fullnode"]
init: true
ports:
- "127.0.0.1:3333:3333"
cap_add:
- NET_ADMIN
deploy:
restart_policy:
condition: on-failure
environment:
RADIXDLT_LOG_LEVEL: "${FULLNODE_LOG_LEVEL}"
RADIXDLT_NETWORK_ID: "${FULLNODE_NETWORK_ID}"
RADIXDLT_NETWORK_SEEDS_REMOTE: "${FULLNODE_NETWORK_BOOTSTRAP_NODE}"
RADIX_NODE_KEYSTORE_PASSWORD: "${FULLNODE_KEY_PASSWORD}"
JAVA_OPTS: --enable-preview -server -Xms8g -Xmx8g -XX:MaxDirectMemorySize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCompressedOops -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStoreType=jks -Djava.security.egd=file:/dev/urandom -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector
RADIXDLT_VALIDATOR_KEY_LOCATION: "/home/radixdlt/node-keystore.ks"
RADIXDLT_CORE_API_PORT: 3333
volumes:
- "./container-volumes/fullnode/ledger:/home/radixdlt/RADIXDB"
- "./container-volumes/fullnode/keystore.ks:/home/radixdlt/node-keystore.ks"
- "./container-volumes/fullnode/logs:/home/radixdlt/logs"
postgres_db:
# See https://hub.docker.com/_/postgres for details about configuration
image: "postgres:15.2-alpine"
shm_size: 256m
profiles: ["network-gateway-built", "network-gateway-image", "network-gateway-resources"]
ports:
- "127.0.0.1:5432:5432"
# The default shutdown mode for this container is SIGINT:
# https://github.com/docker-library/postgres/blob/e483778176ca34bcbe83ee17000820d4f6e64c28/12/alpine/Dockerfile
# This enables fast Shutdown mode - see eg https://www.postgresql.org/docs/10/server-shutdown.html
stop_grace_period: 90s # Ensure the DB is allowed time to stop to prevent needing to recover on next start-up
deploy:
restart_policy:
condition: on-failure
volumes:
- ./container-volumes/.postgresdata:/var/lib/postgresql/data
environment:
POSTGRES_USER: "${POSTGRES_SUPERUSER}"
POSTGRES_PASSWORD: "${POSTGRES_SUPERUSER_PASSWORD}"
POSTGRES_DB: "${POSTGRES_DB_NAME}"
healthcheck:
test: pg_isready -U ${POSTGRES_SUPERUSER} -d ${POSTGRES_DB_NAME}
interval: 10s
timeout: 3s
retries: 3
database_migrations: # This is the base -- the _image and _built containers are defined below
image: "radixdlt/babylon-ng-database-migrations:v1.9.2"
profiles: ["NONE"]
environment:
ConnectionStrings__NetworkGatewayMigrations: "Host=postgres_db:5432;Database=${POSTGRES_DB_NAME};Username=${POSTGRES_SUPERUSER};Password=${POSTGRES_SUPERUSER_PASSWORD}"
data_aggregator: # This is the base -- the _image and _built containers are defined below
image: "radixdlt/babylon-ng-data-aggregator:v1.9.2"
profiles: ["NONE"]
deploy:
restart_policy:
condition: on-failure
ports:
- "127.0.0.1:5207:8080" # This allows you to connect to the API (for root and health checks) at http://localhost:5207
- "127.0.0.1:1234:1234" # This allows you to connect to the metrics API at http://localhost:1234
environment:
# WIPE_DATABASE: "true"
ASPNETCORE_URLS: "http://*:8080" # Binds to 8080 on all interfaces
CustomJsonConfigurationFilePath: "/home/radixdlt/network-gateway/config.json"
PrometheusMetricsPort: "1234"
ConnectionStrings__NetworkGatewayReadWrite: "Host=postgres_db:5432;Database=${POSTGRES_DB_NAME};Username=${POSTGRES_SUPERUSER};Password=${POSTGRES_SUPERUSER_PASSWORD}"
DataAggregator__Network__NetworkName: "${NETWORK_NAME}"
DataAggregator__Network__DisableCoreApiHttpsCertificateChecks: "${DISABLE_CORE_API_CERTIFICATE_CHECKS}"
DataAggregator__Network__CoreApiNodes__0__Name: "${NODE_0_NAME}"
DataAggregator__Network__CoreApiNodes__0__CoreApiAddress: "${NODE_0_CORE_API_ADDRESS}"
DataAggregator__Network__CoreApiNodes__0__CoreApiAuthorizationHeader: "${NODE_0_CORE_API_AUTHORIZATION_HEADER}"
DataAggregator__Network__CoreApiNodes__0__Enabled: "${NODE_0_ENABLED}"
DataAggregator__Network__CoreApiNodes__1__Name: "${NODE_1_NAME}"
DataAggregator__Network__CoreApiNodes__1__CoreApiAddress: "${NODE_1_CORE_API_ADDRESS}"
DataAggregator__Network__CoreApiNodes__1__CoreApiAuthorizationHeader: "${NODE_1_CORE_API_AUTHORIZATION_HEADER}"
DataAggregator__Network__CoreApiNodes__1__Enabled: "${NODE_1_ENABLED}"
DataAggregator__Network__CoreApiNodes__2__Name: "${NODE_2_NAME}"
DataAggregator__Network__CoreApiNodes__2__CoreApiAddress: "${NODE_2_CORE_API_ADDRESS}"
DataAggregator__Network__CoreApiNodes__2__CoreApiAuthorizationHeader: "${NODE_2_CORE_API_AUTHORIZATION_HEADER}"
DataAggregator__Network__CoreApiNodes__2__Enabled: "${NODE_2_ENABLED}"
DataAggregator__Network__CoreApiNodes__3__Name: "${NODE_3_NAME}"
DataAggregator__Network__CoreApiNodes__3__CoreApiAddress: "${NODE_3_CORE_API_ADDRESS}"
DataAggregator__Network__CoreApiNodes__3__CoreApiAuthorizationHeader: "${NODE_3_CORE_API_AUTHORIZATION_HEADER}"
DataAggregator__Network__CoreApiNodes__3__Enabled: "${NODE_3_ENABLED}"
DataAggregator__Network__CoreApiNodes__4__Name: "${NODE_4_NAME}"
DataAggregator__Network__CoreApiNodes__4__CoreApiAddress: "${NODE_4_CORE_API_ADDRESS}"
DataAggregator__Network__CoreApiNodes__4__CoreApiAuthorizationHeader: "${NODE_4_CORE_API_AUTHORIZATION_HEADER}"
DataAggregator__Network__CoreApiNodes__4__Enabled: "${NODE_4_ENABLED}"
volumes:
- ./data-aggregator-fixed-configuration.json:/home/radixdlt/network-gateway/config.json
gateway_api: # This is the base -- the _image and _built containers are defined below
image: "radixdlt/babylon-ng-gateway-api:v1.9.2"
profiles: ["NONE"]
ports:
- "127.0.0.1:5308:8080" # This allows you to connect to the API at http://localhost:5308
- "127.0.0.1:1235:1235" # This allows you to connect to the metrics API at http://localhost:1235
deploy:
restart_policy:
condition: on-failure
environment:
ASPNETCORE_URLS: "http://*:8080" # Binds to 8080 on all interfaces
CustomJsonConfigurationFilePath: "/home/radixdlt/network-gateway/config.json"
PrometheusMetricsPort: "1235"
EnableSwagger: "${ENABLE_SWAGGER}"
ConnectionStrings__NetworkGatewayReadOnly: "Host=postgres_db:5432;Database=${POSTGRES_DB_NAME};Username=${POSTGRES_SUPERUSER};Password=${POSTGRES_SUPERUSER_PASSWORD}"
ConnectionStrings__NetworkGatewayReadWrite: "Host=postgres_db:5432;Database=${POSTGRES_DB_NAME};Username=${POSTGRES_SUPERUSER};Password=${POSTGRES_SUPERUSER_PASSWORD}"
GatewayApi__Endpoint__MaxPageSize: "${MAX_PAGE_SIZE}"
GatewayApi__Endpoint__DefaultPageSize: "${DEFAULT_PAGE_SIZE}"
GatewayApi__AcceptableLedgerLag__PreventReadRequestsIfDbLedgerIsBehind: "${PREVENT_OUTDATED_READ_REQUESTS}"
GatewayApi__AcceptableLedgerLag__PreventConstructionRequestsIfDbLedgerIsBehind: "${PREVENT_OUTDATED_CONSTRUCTION_REQUESTS}"
GatewayApi__Network__NetworkName: "${NETWORK_NAME}"
GatewayApi__Network__DisableCoreApiHttpsCertificateChecks: "${DISABLE_CORE_API_CERTIFICATE_CHECKS}"
GatewayApi__Network__CoreApiNodes__0__Name: "${NODE_0_NAME}"
GatewayApi__Network__CoreApiNodes__0__CoreApiAddress: "${NODE_0_CORE_API_ADDRESS}"
GatewayApi__Network__CoreApiNodes__0__CoreApiAuthorizationHeader: "${NODE_0_CORE_API_AUTHORIZATION_HEADER}"
GatewayApi__Network__CoreApiNodes__0__RequestWeighting: "1"
GatewayApi__Network__CoreApiNodes__0__Enabled: "${NODE_0_ENABLED}"
GatewayApi__Network__CoreApiNodes__1__Name: "${NODE_1_NAME}"
GatewayApi__Network__CoreApiNodes__1__CoreApiAddress: "${NODE_1_CORE_API_ADDRESS}"
GatewayApi__Network__CoreApiNodes__1__CoreApiAuthorizationHeader: "${NODE_1_CORE_API_AUTHORIZATION_HEADER}"
GatewayApi__Network__CoreApiNodes__1__RequestWeighting: "1"
GatewayApi__Network__CoreApiNodes__1__Enabled: "${NODE_1_ENABLED}"
GatewayApi__Network__CoreApiNodes__2__Name: "${NODE_2_NAME}"
GatewayApi__Network__CoreApiNodes__2__CoreApiAddress: "${NODE_2_CORE_API_ADDRESS}"
GatewayApi__Network__CoreApiNodes__2__CoreApiAuthorizationHeader: "${NODE_2_CORE_API_AUTHORIZATION_HEADER}"
GatewayApi__Network__CoreApiNodes__2__RequestWeighting: "1"
GatewayApi__Network__CoreApiNodes__2__Enabled: "${NODE_2_ENABLED}"
GatewayApi__Network__CoreApiNodes__3__Name: "${NODE_3_NAME}"
GatewayApi__Network__CoreApiNodes__3__CoreApiAddress: "${NODE_3_CORE_API_ADDRESS}"
GatewayApi__Network__CoreApiNodes__3__CoreApiAuthorizationHeader: "${NODE_3_CORE_API_AUTHORIZATION_HEADER}"
GatewayApi__Network__CoreApiNodes__3__RequestWeighting: "1"
GatewayApi__Network__CoreApiNodes__3__Enabled: "${NODE_3_ENABLED}"
GatewayApi__Network__CoreApiNodes__4__Name: "${NODE_4_NAME}"
GatewayApi__Network__CoreApiNodes__4__CoreApiAddress: "${NODE_4_CORE_API_ADDRESS}"
GatewayApi__Network__CoreApiNodes__4__CoreApiAuthorizationHeader: "${NODE_4_CORE_API_AUTHORIZATION_HEADER}"
GatewayApi__Network__CoreApiNodes__4__RequestWeighting: "1"
GatewayApi__Network__CoreApiNodes__4__Enabled: "${NODE_4_ENABLED}"
volumes:
- ./gateway-api-fixed-configuration.json:/home/radixdlt/network-gateway/config.json
database_migrations_image:
# NB - image: is defined in the base data_aggregator
extends:
service: database_migrations
profiles: ["network-gateway-image"]
depends_on:
postgres_db:
condition: service_healthy
data_aggregator_image:
# NB - image: is defined in the base data_aggregator
extends:
service: data_aggregator
profiles: ["network-gateway-image"]
depends_on:
database_migrations_image:
condition: service_completed_successfully
gateway_api_image:
# NB - image: is defined in the base gateway_api
extends:
service: gateway_api
profiles: ["network-gateway-image"]
depends_on:
database_migrations_image:
condition: service_completed_successfully
database_migrations_built:
# NB - image: is defined in the base gateway_api
extends:
service: database_migrations
profiles: ["network-gateway-built"]
build: # build: takes higher priority over image:, so this allows us to capture all the config, but replace the image with a direct build
context: "../"
dockerfile: "./apps/DatabaseMigrations/Dockerfile"
depends_on:
postgres_db:
condition: service_healthy
data_aggregator_built:
extends:
service: data_aggregator
profiles: ["network-gateway-built"]
build: # build: takes higher priority over image:, so this allows us to capture all the config, but replace the image with a direct build
context: "../"
dockerfile: "./apps/DataAggregator/Dockerfile"
depends_on:
database_migrations_built:
condition: service_completed_successfully
gateway_api_built:
extends:
service: gateway_api
profiles: ["network-gateway-built"]
build: # build: takes higher priority over image:, so this allows us to capture all the config, but replace the image with a direct build
context: "../"
dockerfile: "./apps/GatewayAPI/Dockerfile"
depends_on:
database_migrations_built:
condition: service_completed_successfully