-
-
Notifications
You must be signed in to change notification settings - Fork 101
/
docker-compose.yml
60 lines (55 loc) · 1.72 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
version: '3'
services:
db:
image: postgres:12
ports:
- "5432:5432"
environment:
POSTGRES_DB: app_db
POSTGRES_USER: app_user
POSTGRES_PASSWORD: postgres!secret
volumes:
- ./data/postgres:/var/lib/postgresql/data
- ./create_tables.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U app_user -d app_db"]
interval: 5s
timeout: 15s
retries: 5
postgrest:
image: postgrest/postgrest
ports:
- "3000:3000"
environment:
PGRST_DB_URI: postgres://app_user:postgres!secret@db:5432/app_db
PGRST_DB_SCHEMA: public
PGRST_DB_ANON_ROLE: app_user #In production this role should not be the same as the one used for the connection
PGRST_OPENAPI_SERVER_PROXY_URI: "http://127.0.0.1:3000"
depends_on:
- db
# this is a test node. Remove it and change the ETH_URL in the eth-storage service
publicnode:
image: ethereum/client-go:latest
ports:
- 8545:8545
- 8546:8546
command: --dev --dev.period 3 --http --http.addr 0.0.0.0 --http.api web3,eth,admin,personal,net --http.vhosts '*' --ws --ws.addr 0.0.0.0 --ws.port 8546 --ws.api web3,eth,admin,personal,net --datadir /tmp --allow-insecure-unlock
healthcheck:
test: ["CMD-SHELL", "wget -q -O - http://localhost:8545"]
interval: 5s
timeout: 15s
retries: 5
# Attention
eth-storage:
build: .
environment:
DB_NAME: postgres://app_user:postgres!secret@db:5432/app_db
ETH_URL: ws://publicnode:8546
START_BLOCK: 1
CONFIRMATIONS_BLOCK: 3
PERIOD: 5
depends_on:
db:
condition: service_healthy
publicnode:
condition: service_healthy