mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
add a healthcheck and resource limits
This commit is contained in:
parent
a342d3cfaa
commit
7850828989
1 changed files with 18 additions and 1 deletions
|
|
@ -8,10 +8,13 @@ services:
|
||||||
# build:
|
# build:
|
||||||
# dockerfile: Dockerfile
|
# dockerfile: Dockerfile
|
||||||
# context: .
|
# context: .
|
||||||
|
|
||||||
### override default 'geth' entrypoint to use a local devnet
|
### override default 'geth' entrypoint to use a local devnet
|
||||||
|
### with persistent blockchain and account data (--datadir flag)
|
||||||
entrypoint: "geth --dev --datadir /root/.ethereum --http --http.api eth,web3,net --http.addr 0.0.0.0 --http.corsdomain 'https://remix.ethereum.org'"
|
entrypoint: "geth --dev --datadir /root/.ethereum --http --http.api eth,web3,net --http.addr 0.0.0.0 --http.corsdomain 'https://remix.ethereum.org'"
|
||||||
volumes:
|
volumes:
|
||||||
- "./geth-data:/root/.ethereum"
|
- "./geth-data:/root/.ethereum"
|
||||||
|
|
||||||
### keep to pass any env vars if necessary
|
### keep to pass any env vars if necessary
|
||||||
# env_file:
|
# env_file:
|
||||||
# - ".env"
|
# - ".env"
|
||||||
|
|
@ -23,7 +26,21 @@ services:
|
||||||
networks:
|
networks:
|
||||||
go-ethereum:
|
go-ethereum:
|
||||||
ipv4_address: 172.25.0.2
|
ipv4_address: 172.25.0.2
|
||||||
restart: "no"
|
healthcheck:
|
||||||
|
### test whether a tcp connection on the RPC port is successful
|
||||||
|
test: ["CMD-SHELL", "nc -w 1 -v localhost 8545 || exit 1"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 3
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
reservations:
|
||||||
|
cpus: "1"
|
||||||
|
memory: "1G"
|
||||||
|
limits:
|
||||||
|
cpus: "2"
|
||||||
|
memory: "2G"
|
||||||
|
restart: "on-failure:3"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
go-ethereum:
|
go-ethereum:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue