-
Notifications
You must be signed in to change notification settings - Fork 115
/
Copy pathdocker-compose.yml
217 lines (195 loc) · 6.88 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
# SPDX-License-Identifier: Apache-2.0
services:
api-proxy:
configs:
- source: proxy-config
target: /etc/nginx/conf.d/default.conf
image: nginx:1-alpine
restart: unless-stopped
ports:
- 8080:8080
tty: true
db:
environment:
PGDATA: /var/lib/postgresql/data
POSTGRES_HOST_AUTH_METHOD: scram-sha-256
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256
POSTGRES_PASSWORD: postgres_password
image: postgres:16-alpine
ports:
- 5432:5432
restart: unless-stopped
stop_grace_period: 2m
stop_signal: SIGTERM
tty: true
volumes:
- ./db:/var/lib/postgresql/data
- ./hedera-mirror-importer/src/main/resources/db/scripts/init.sh:/docker-entrypoint-initdb.d/init.sh
graphql:
configs:
- source: app-config
target: /usr/etc/hedera/application.yml
deploy:
replicas: 0
environment:
HEDERA_MIRROR_GRAPHQL_DB_HOST: db
SPRING_CONFIG_ADDITIONAL_LOCATION: file:/usr/etc/hedera/
image: gcr.io/mirrornode/hedera-mirror-graphql:0.126.0-SNAPSHOT
ports:
- 8083:8083
pull_policy: always
restart: unless-stopped
tty: true
grpc:
configs:
- source: app-config
target: /usr/etc/hedera/application.yml
environment:
HEDERA_MIRROR_GRPC_DB_HOST: db
SPRING_CONFIG_ADDITIONAL_LOCATION: file:/usr/etc/hedera/
SPRING_DATA_REDIS_HOST: redis
image: gcr.io/mirrornode/hedera-mirror-grpc:0.126.0-SNAPSHOT
ports:
- 5600:5600
pull_policy: always
restart: unless-stopped
tty: true
importer:
configs:
- source: app-config
target: /usr/etc/hedera/application.yml
environment:
HEDERA_MIRROR_IMPORTER_DB_HOST: db
SPRING_CONFIG_ADDITIONAL_LOCATION: file:/usr/etc/hedera/
SPRING_DATA_REDIS_HOST: redis
image: gcr.io/mirrornode/hedera-mirror-importer:0.126.0-SNAPSHOT
pull_policy: always
restart: unless-stopped
tty: true
monitor:
configs:
- source: app-config
target: /usr/etc/hedera/application.yml
deploy:
replicas: 0
environment:
SPRING_CONFIG_ADDITIONAL_LOCATION: file:/usr/etc/hedera/
image: gcr.io/mirrornode/hedera-mirror-monitor:0.126.0-SNAPSHOT
pull_policy: always
restart: unless-stopped
redis:
image: redis:6-alpine
ports:
- 6379:6379
restart: unless-stopped
stop_grace_period: 2m
stop_signal: SIGTERM
tty: true
rest:
configs:
- source: app-config
target: /usr/etc/hedera/application.yml
environment:
CONFIG_PATH: /usr/etc/hedera/
HEDERA_MIRROR_REST_DB_HOST: db
HEDERA_MIRROR_REST_REDIS_URI: redis://redis:6379
image: gcr.io/mirrornode/hedera-mirror-rest:0.126.0-SNAPSHOT
pull_policy: always
ports:
- 5551:5551
restart: unless-stopped
tty: true
rest-java:
configs:
- source: app-config
target: /usr/etc/hedera/application.yml
environment:
HEDERA_MIRROR_RESTJAVA_DB_HOST: db
SPRING_CONFIG_ADDITIONAL_LOCATION: file:/usr/etc/hedera/
image: gcr.io/mirrornode/hedera-mirror-rest-java:0.126.0-SNAPSHOT
pull_policy: always
ports:
- 8084:8084
restart: unless-stopped
tty: true
rosetta:
configs:
- source: app-config
target: /usr/etc/hedera/application.yml
deploy:
replicas: 0
environment:
HEDERA_MIRROR_ROSETTA_API_CONFIG: /usr/etc/hedera/application.yml
HEDERA_MIRROR_ROSETTA_DB_HOST: db
image: gcr.io/mirrornode/hedera-mirror-rosetta:0.126.0-SNAPSHOT
pull_policy: always
ports:
- 5700:5700
restart: unless-stopped
tty: true
web3:
configs:
- source: app-config
target: /usr/etc/hedera/application.yml
environment:
HEDERA_MIRROR_WEB3_DB_HOST: db
SPRING_CONFIG_ADDITIONAL_LOCATION: file:/usr/etc/hedera/
image: gcr.io/mirrornode/hedera-mirror-web3:0.126.0-SNAPSHOT
pull_policy: always
ports:
- 8545:8545
restart: unless-stopped
tty: true
configs:
app-config:
content: |
hedera:
mirror:
importer:
network: DEMO # Select one of PREVIEWNET/TESTNET/MAINNET and populate below config
# downloader:
# accessKey: {GOOG1E/AWS....}
# cloudProvider: "GCP/S3"
# gcpProjectId: {projectId} # N/A for AWS
# secretKey: {GOOG1E/AWS....}
proxy-config:
content: |
# YAML uses $ for variable substitution, so we use $$ when using nginx variables.
# The upstream directive allows the use of the keepalive (good for performance),
# but the hostname must be resolvable when nginx starts.
upstream grpc_host { server grpc:5600; keepalive 16; }
upstream rest_host { server rest:5551; keepalive 16; }
upstream rest_java_host { server rest-java:8084; keepalive 16; }
upstream web3_host { server web3:8545; keepalive 16; }
server {
# graphql and rosetta are optional containers, disabled by default, so we cannot leverage the upstream directive.
set $$graphql_host graphql:8083;
set $$rosetta_host rosetta:5700;
# common configurations
listen 8080;
proxy_http_version 1.1;
proxy_set_header Host $$host;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header X-Forwarded-For $$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $$scheme;
proxy_set_header "Connection" "";
resolver 127.0.0.11 valid=600s; # let docker resolve the host names
http2 on; # enable gRPC
# web3 host
location /api/v1/contracts/call { proxy_pass http://web3_host$$request_uri; }
location ~ "^/api/v1/contracts/results/((0x)?[A-Fa-f0-9]{64}|\d+\.\d+\.\d+-\d+-\d+)/opcodes" { proxy_pass http://web3_host$$request_uri; }
# rest-java host
location ~ "^/api/v1/accounts/(\d+\.){0,2}(\d+|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))/(allowances/nfts|airdrops)" { proxy_pass http://rest_java_host$$request_uri; }
location ~ "^/api/v1/topics/(\d+\.){0,2}\d+$" { proxy_pass http://rest_java_host$$request_uri; }
# rest host
location /api/v1/ { proxy_pass http://rest_host$$request_uri; }
# grpc host
# Setting 600s read timeout for topic subscription. When the client receives a message the timeout resets to 0.
location = /com.hedera.mirror.api.proto.ConsensusService/subscribeTopic { grpc_read_timeout 600s; grpc_pass grpc://grpc_host; }
location /com.hedera.mirror.api.proto. { grpc_pass grpc://grpc_host; }
location /grpc.reflection.v1alpha.ServerReflection { grpc_pass grpc://grpc_host; }
# graphql host
location = /graphql/alpha { proxy_pass http://$$graphql_host$$request_uri; }
# rosetta host
location /rosetta/ { rewrite ^/rosetta/(.*) /$$1 break; proxy_pass http://$$rosetta_host; }
}