-
Notifications
You must be signed in to change notification settings - Fork 112
/
Copy pathdocker-compose.yml
189 lines (169 loc) · 6.34 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
services:
api-proxy:
image: nginx:1-alpine
restart: unless-stopped
ports:
- 8080:8080
tty: true
configs:
- source: api-proxy-inline-config
target: /etc/nginx/conf.d/default.conf
db:
image: postgres:16-alpine
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
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:
image: gcr.io/mirrornode/hedera-mirror-graphql:0.122.0-SNAPSHOT
pull_policy: always
deploy:
replicas: 0
environment:
HEDERA_MIRROR_GRAPHQL_DB_HOST: db
SPRING_CONFIG_ADDITIONAL_LOCATION: file:/usr/etc/hedera-mirror-graphql/
ports:
- 8083:8083
restart: unless-stopped
tty: true
volumes:
- ./application.yml:/usr/etc/hedera-mirror-graphql/application.yml
grpc:
image: gcr.io/mirrornode/hedera-mirror-grpc:0.122.0-SNAPSHOT
pull_policy: always
restart: unless-stopped
environment:
HEDERA_MIRROR_GRPC_DB_HOST: db
SPRING_CONFIG_ADDITIONAL_LOCATION: file:/usr/etc/hedera-mirror-grpc/
SPRING_DATA_REDIS_HOST: redis
ports:
- 5600:5600
volumes:
- ./application.yml:/usr/etc/hedera-mirror-grpc/application.yml
importer:
image: gcr.io/mirrornode/hedera-mirror-importer:0.122.0-SNAPSHOT
pull_policy: always
restart: unless-stopped
environment:
HEDERA_MIRROR_IMPORTER_DB_HOST: db
SPRING_CONFIG_ADDITIONAL_LOCATION: file:/usr/etc/hedera-mirror-importer/
SPRING_DATA_REDIS_HOST: redis
volumes:
- ./application.yml:/usr/etc/hedera-mirror-importer/application.yml
monitor:
deploy:
replicas: 0
image: gcr.io/mirrornode/hedera-mirror-monitor:0.122.0-SNAPSHOT
pull_policy: always
restart: unless-stopped
environment:
SPRING_CONFIG_ADDITIONAL_LOCATION: file:/usr/etc/hedera-mirror-monitor/
volumes:
- ./application.yml:/usr/etc/hedera-mirror-monitor/application.yml
redis:
image: redis:6-alpine
ports:
- 6379:6379
restart: unless-stopped
stop_grace_period: 2m
stop_signal: SIGTERM
tty: true
rest:
image: gcr.io/mirrornode/hedera-mirror-rest:0.122.0-SNAPSHOT
pull_policy: always
environment:
HEDERA_MIRROR_REST_DB_HOST: db
HEDERA_MIRROR_REST_REDIS_URI: redis://redis:6379
ports:
- 5551:5551
restart: unless-stopped
tty: true
rest-java:
image: gcr.io/mirrornode/hedera-mirror-rest-java:0.122.0-SNAPSHOT
pull_policy: always
environment:
HEDERA_MIRROR_RESTJAVA_DB_HOST: db
SPRING_CONFIG_ADDITIONAL_LOCATION: file:/usr/etc/hedera-mirror-rest-java/
ports:
- 8084:8084
restart: unless-stopped
tty: true
volumes:
- ./application.yml:/usr/etc/hedera-mirror-rest-java/application.yml
rosetta:
image: gcr.io/mirrornode/hedera-mirror-rosetta:0.122.0-SNAPSHOT
deploy:
replicas: 0
pull_policy: always
environment:
HEDERA_MIRROR_ROSETTA_DB_HOST: db
ports:
- 5700:5700
restart: unless-stopped
tty: true
volumes:
- ./application.yml:/src/hedera-mirror-rosetta/application.yml
web3:
image: gcr.io/mirrornode/hedera-mirror-web3:0.122.0-SNAPSHOT
pull_policy: always
environment:
HEDERA_MIRROR_WEB3_DB_HOST: db
SPRING_CONFIG_ADDITIONAL_LOCATION: file:/usr/etc/hedera-mirror-web3/
ports:
- 8545:8545
restart: unless-stopped
tty: true
volumes:
- ./application.yml:/usr/etc/hedera-mirror-web3/application.yml
configs:
api-proxy-inline-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; }
}