Skip to content

Commit e0d28b8

Browse files
authored
Merge pull request #7 from Golem-Base/marszy/golembase-external-frontend
Add Golem Base external frontend compose file
2 parents 20dfe95 + 05d8236 commit e0d28b8

1 file changed

Lines changed: 253 additions & 0 deletions

File tree

Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
# Blockscout frontend development is made easy by calling:
2+
# `docker compose -f golembase-external-frontend.yml up --build`
3+
# and inside the frontend repo, doing: `yarn dev:preset golembase.localhost`
4+
#
5+
# The local frontend instance will be exposed at localhost:3000, which is then
6+
# proxied by nginx from 172.17.0.1:3000 (docker's host ip address)
7+
# to :80. To access it, open http://localhost/ in Your web browser
8+
9+
services:
10+
redis-db:
11+
extends:
12+
file: ./services/redis.yml
13+
service: redis-db
14+
volumes:
15+
- redis-data:/data
16+
17+
db-init:
18+
extends:
19+
file: ./services/db.yml
20+
service: db-init
21+
volumes:
22+
- blockscout-db-data:/var/lib/postgresql/data
23+
24+
db:
25+
depends_on:
26+
db-init:
27+
condition: service_completed_successfully
28+
extends:
29+
file: ./services/db.yml
30+
service: db
31+
volumes:
32+
- blockscout-db-data:/var/lib/postgresql/data
33+
34+
backend:
35+
depends_on:
36+
- db
37+
- redis-db
38+
- golembase-op-geth
39+
extends:
40+
file: ./services/backend.yml
41+
service: backend
42+
links:
43+
- db:database
44+
environment:
45+
ETHEREUM_JSONRPC_VARIANT: 'geth'
46+
build:
47+
context: ..
48+
dockerfile: ./docker/Dockerfile
49+
args:
50+
RELEASE_VERSION: 8.1.0
51+
pull_policy: build
52+
volumes:
53+
- logs:/app/logs/
54+
- dets:/app/dets/
55+
56+
visualizer:
57+
extends:
58+
file: ./services/visualizer.yml
59+
service: visualizer
60+
61+
sig-provider:
62+
extends:
63+
file: ./services/sig-provider.yml
64+
service: sig-provider
65+
66+
stats-db-init:
67+
extends:
68+
file: ./services/stats.yml
69+
service: stats-db-init
70+
volumes:
71+
- stats-db-data:/var/lib/postgresql/data
72+
73+
stats-db:
74+
depends_on:
75+
stats-db-init:
76+
condition: service_completed_successfully
77+
extends:
78+
file: ./services/stats.yml
79+
service: stats-db
80+
volumes:
81+
- stats-db-data:/var/lib/postgresql/data
82+
83+
stats:
84+
depends_on:
85+
- stats-db
86+
- backend
87+
extends:
88+
file: ./services/stats.yml
89+
service: stats
90+
91+
user-ops-indexer:
92+
depends_on:
93+
- db
94+
- backend
95+
extends:
96+
file: ./services/user-ops-indexer.yml
97+
service: user-ops-indexer
98+
99+
proxy:
100+
depends_on:
101+
- backend
102+
- stats
103+
extends:
104+
file: ./services/nginx.yml
105+
service: proxy
106+
environment:
107+
- FRONT_PROXY_PASS=http://172.17.0.1:3000
108+
109+
110+
##############
111+
# Golem Base #
112+
##############
113+
114+
golembase-setup:
115+
image: alpine:latest
116+
volumes:
117+
- mongodb_keyfile:/mongodb-keyfile
118+
command: >
119+
/bin/sh -c "
120+
mkdir -p /mongodb-keyfile;
121+
if [ ! -f /mongodb-keyfile/mongodb-keyfile ]; then
122+
echo 'ThisIsA32ByteKeyForMongoDBReplSet' > /mongodb-keyfile/mongodb-keyfile;
123+
chmod 400 /mongodb-keyfile/mongodb-keyfile;
124+
chown 999:999 /mongodb-keyfile/mongodb-keyfile;
125+
fi;
126+
echo 'MongoDB keyfile initialized'
127+
"
128+
129+
golembase-op-geth:
130+
container_name: golembase-op-geth
131+
build:
132+
context: ../../golembase-op-geth
133+
dockerfile: Dockerfile
134+
ports:
135+
- "8545:8545"
136+
volumes:
137+
- golembase_wal:/golembase.wal
138+
- geth_data:/geth_data
139+
command: >
140+
--dev
141+
--http
142+
--http.api 'eth,web3,net,debug,txpool,golembase'
143+
--verbosity 3
144+
--http.addr '0.0.0.0'
145+
--http.port 8545
146+
--http.corsdomain '*'
147+
--http.vhosts '*'
148+
--ws
149+
--ws.addr '0.0.0.0'
150+
--ws.port 8545
151+
--golembase.writeaheadlog '/golembase.wal/'
152+
--datadir '/geth_data'
153+
healthcheck:
154+
test: ["CMD", "curl", "-f", "http://localhost:8545"]
155+
interval: 5s
156+
timeout: 5s
157+
retries: 5
158+
159+
golembase-mongodb:
160+
image : mongo:8.0.6
161+
container_name: golembase-mongodb
162+
hostname: mongodb
163+
restart: on-failure
164+
environment:
165+
- PUID=1000
166+
- PGID=1000
167+
- MONGO_INITDB_ROOT_USERNAME=admin
168+
- MONGO_INITDB_ROOT_PASSWORD=password
169+
- MONGO_REPLICA_SET_NAME=rs0
170+
ports:
171+
- 27017:27017
172+
extra_hosts:
173+
- "host.docker.internal:host-gateway"
174+
healthcheck:
175+
test: |
176+
echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'172.17.0.1:27017'}]}) }" | mongosh "mongodb://admin:password@golembase-mongodb:27017/admin?authSource=admin"
177+
interval: 10s
178+
start_period: 30s
179+
command: "--bind_ip_all --keyFile /keyfile/mongodb-keyfile --replSet rs0 --dbpath /data/db"
180+
depends_on:
181+
golembase-setup:
182+
condition: service_completed_successfully
183+
volumes:
184+
- mongodb_keyfile:/keyfile:ro
185+
- mongodb_data:/data/db
186+
187+
golembase-mongodb-etl:
188+
build:
189+
context: ../../golembase-op-geth
190+
dockerfile: Dockerfile
191+
depends_on:
192+
golembase-mongodb:
193+
condition: service_healthy
194+
golembase-op-geth:
195+
condition: service_healthy
196+
volumes:
197+
- golembase_wal:/golembase.wal
198+
environment:
199+
- MONGO_URI=mongodb://admin:password@golembase-mongodb:27017
200+
- WAL_PATH=/golembase.wal
201+
- RPC_ENDPOINT=http://golembase-op-geth:8545
202+
- DB_NAME=golembase
203+
entrypoint: []
204+
command: >
205+
/usr/local/bin/mongodb
206+
--wal /golembase.wal
207+
--mongo-uri mongodb://admin:password@golembase-mongodb:27017
208+
--rpc-endpoint http://golembase-op-geth:8545
209+
--db-name golembase
210+
211+
golembase-sqlite-etl:
212+
build:
213+
context: ../../golembase-op-geth
214+
dockerfile: Dockerfile
215+
depends_on:
216+
golembase-op-geth:
217+
condition: service_healthy
218+
volumes:
219+
- golembase_wal:/golembase.wal
220+
- golembase_sqlite:/golembase-sqlite
221+
environment:
222+
- RPC_ENDPOINT=http://golembase-op-geth:8545
223+
- WAL_PATH=/tmp/golembase.wal
224+
- DB_PATH=/tmp/golembase-sqlite
225+
entrypoint: []
226+
command: >
227+
/usr/local/bin/sqlite
228+
--wal /golembase.wal
229+
--db /golembase-sqlite/db
230+
--rpc-endpoint http://golembase-op-geth:8545
231+
232+
golembase-rpcplorer:
233+
image: dmilhdef/rpcplorer:v0.0.1
234+
depends_on:
235+
golembase-op-geth:
236+
condition: service_healthy
237+
ports:
238+
- "8090:8080"
239+
environment:
240+
- NODE_URL=http://golembase-op-geth:8545
241+
restart: on-failure
242+
243+
volumes:
244+
mongodb_keyfile:
245+
mongodb_data:
246+
golembase_wal:
247+
golembase_sqlite:
248+
geth_data:
249+
logs:
250+
dets:
251+
blockscout-db-data:
252+
redis-data:
253+
stats-db-data:

0 commit comments

Comments
 (0)