forked from matter-labs/block-explorer
-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yaml
153 lines (146 loc) · 3.86 KB
/
docker-compose.yaml
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
name: block-explorer
services:
app:
build:
context: .
dockerfile: ./packages/app/Dockerfile
target: development-stage
command: npm run --prefix packages/app dev -- --host
ports:
- '3010:3010'
volumes:
- ./packages/app:/usr/src/app/packages/app
- /usr/src/app/packages/app/node_modules
depends_on:
- api
restart: unless-stopped
worker:
build:
context: .
dockerfile: ./packages/worker/Dockerfile
target: development-stage
command: npm run --prefix packages/worker dev:debug
environment:
- PORT=3001
- LOG_LEVEL=verbose
- NODE_ENV=development
- DATABASE_HOST=postgres
- DATABASE_USER=postgres
- DATABASE_PASSWORD=postgres
- DATABASE_NAME=block-explorer
- BLOCKCHAIN_RPC_URL=http://zksync:3050
- DATA_FETCHER_URL=http://data-fetcher:3040
- BATCHES_PROCESSING_POLLING_INTERVAL=1000
ports:
- '3001:3001'
- '9229:9229'
- '9230:9230'
volumes:
- ./packages/worker:/usr/src/app/packages/worker
- /usr/src/app/packages/worker/node_modules
depends_on:
zksync:
condition: service_healthy
restart: unless-stopped
data-fetcher:
build:
context: .
dockerfile: ./packages/data-fetcher/Dockerfile
target: development-stage
command: npm run --prefix packages/data-fetcher dev:debug
environment:
- PORT=3040
- LOG_LEVEL=verbose
- NODE_ENV=development
- BLOCKCHAIN_RPC_URL=http://zksync:3050
ports:
- '3040:3040'
- '9231:9229'
- '9232:9230'
volumes:
- ./packages/data-fetcher:/usr/src/app/packages/data-fetcher
- /usr/src/app/packages/data-fetcher/node_modules
depends_on:
zksync:
condition: service_healthy
restart: unless-stopped
api:
build:
context: .
dockerfile: ./packages/api/Dockerfile
target: development-stage
command: npm run --prefix packages/api dev:debug
environment:
- PORT=3020
- METRICS_PORT=3005
- LOG_LEVEL=verbose
- NODE_ENV=development
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/block-explorer
ports:
- '3020:3020'
- '3005:3005'
- '9233:9229'
- '9234:9230'
volumes:
- ./packages/api:/usr/src/app/packages/api
- /usr/src/app/packages/api/node_modules
depends_on:
- worker
restart: unless-stopped
postgres:
image: "postgres:14"
logging:
driver: none
volumes:
- postgres:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=block-explorer
geth:
image: "matterlabs/geth:latest"
logging:
driver: none
ports:
- "8545:8545"
- "8546:8546"
volumes:
- geth:/var/lib/geth/data
zksync:
stdin_open: true
tty: true
image: matterlabs/local-node:latest2.0
depends_on:
postgres:
condition: service_healthy
geth:
condition: service_started
ports:
- "3050:3050" # JSON RPC HTTP port
- "3051:3051" # JSON RPC WS port
volumes:
# Configs folder bind
- zksync-config:/etc/env/
# Storage folder bind
- zksync-data:/var/lib/zksync/data
environment:
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/zksync_local
- ETH_CLIENT_WEB3_URL=http://geth:8545
healthcheck:
test: "curl -H \"Content-Type: application/json\" -X POST --data '{\"jsonrpc\":\"2.0\",\"method\":\"web3_clientVersion\",\"params\":[],\"id\":67}' 127.0.0.1:3050 || exit 1"
interval: 5s
timeout: 5s
retries: 120
restart: unless-stopped
volumes:
geth:
postgres:
zksync-config:
zksync-data: