forked from erigontech/erigon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
88 lines (73 loc) · 3.76 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
# Erigon by default is "all in one binary" solution, but it's possible start TxPool as separated processes.
# Same true about: JSON RPC layer (RPCDaemon), p2p layer (Sentry), history download layer (Downloader), consensus.
# Don't start services as separated processes unless you have clear reason for it: resource limiting, scale, replace by your own implementation, security.
# This file is an example: how to start Erigon's services as separated processes.
# Default: --datadir=/home/erigon/.local/share/erigon
# Default UID: 3473
# Default GID: 3473
# Ports: `9090` execution engine (private api), `9091` sentry, `9092` consensus engine, `9093` snapshot downloader, `9094` TxPool
# Ports: `8545` json rpc, `8551` consensus json rpc, `30303` eth p2p protocol, `42069` bittorrent protocol,
# Connections: erigon -> (sentries, downloader), rpcdaemon -> (erigon, txpool), txpool -> erigon
version: '2.2'
# Basic erigon's service
x-erigon-service: &default-erigon-service
image: thorax/erigon:${TAG:-latest}
pid: service:erigon # Use erigon's PID namespace. It's required to open Erigon's DB from another process (RPCDaemon local-mode)
volumes_from: [ erigon ]
restart: unless-stopped
mem_swappiness: 0
user: ${DOCKER_UID:-1000}:${DOCKER_GID:-1000}
services:
erigon:
image: thorax/erigon:${TAG:-latest}
build:
args:
UID: ${DOCKER_UID:-1000}
GID: ${DOCKER_GID:-1000}
context: .
command: |
erigon ${ERIGON_FLAGS-} --private.api.addr=0.0.0.0:9090
--sentry.api.addr=sentry:9091 --downloader.api.addr=downloader:9093 --txpool.disable
--metrics --metrics.addr=0.0.0.0 --metrics.port=6060 --pprof --pprof.addr=0.0.0.0 --pprof.port=6061
volumes:
# It's ok to mount sub-dirs of "datadir" to different drives
- ${XDG_DATA_HOME:-~/.local/share}/erigon:/home/erigon/.local/share/erigon
restart: unless-stopped
mem_swappiness: 0
sentry:
<<: *default-erigon-service
command: sentry ${SENTRY_FLAGS-} --sentry.api.addr=0.0.0.0:9091
ports: [ "30303:30303/tcp", "30303:30303/udp" ]
downloader:
<<: *default-erigon-service
command: downloader ${DOWNLOADER_FLAGS-} --downloader.api.addr=0.0.0.0:9093
ports: [ "42069:42069/tcp", "42069:42069/udp" ]
txpool:
<<: *default-erigon-service
command: txpool ${TXPOOL_FLAGS-} --private.api.addr=erigon:9090 --txpool.api.addr=0.0.0.0:9094
rpcdaemon:
<<: *default-erigon-service
command: |
rpcdaemon ${RPCDAEMON_FLAGS-} --http.addr=0.0.0.0 --http.vhosts=* --http.corsdomain=* --ws
--private.api.addr=erigon:9090 --txpool.api.addr=txpool:9094
--authrpc.jwtsecret=/home/erigon/.local/share/erigon/jwt.hex
ports: [ "8545:8545" ] # "8551:8551"
prometheus:
image: prom/prometheus:v2.37.0
user: ${DOCKER_UID:-1000}:${DOCKER_GID:-1000} # Uses erigon user from Dockerfile
command: --log.level=warn --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/prometheus --storage.tsdb.retention.time=150d --web.console.libraries=/usr/share/prometheus/console_libraries --web.console.templates=/usr/share/prometheus/consoles
ports: [ "9090:9090" ]
volumes:
- ${ERIGON_PROMETHEUS_CONFIG:-./cmd/prometheus/prometheus.yml}:/etc/prometheus/prometheus.yml
- ${XDG_DATA_HOME:-~/.local/share}/erigon-prometheus:/prometheus
restart: unless-stopped
grafana:
image: grafana/grafana:9.0.3
user: "472:0" # required for grafana version >= 7.3
ports: [ "3000:3000" ]
volumes:
- ${ERIGON_GRAFANA_CONFIG:-./cmd/prometheus/grafana.ini}:/etc/grafana/grafana.ini
- ./cmd/prometheus/datasources:/etc/grafana/provisioning/datasources
- ./cmd/prometheus/dashboards:/etc/grafana/provisioning/dashboards
- ${XDG_DATA_HOME:-~/.local/share}/erigon-grafana:/var/lib/grafana
restart: unless-stopped