# refer to https://blog.reddio.com/eth-full-node-and-pathfinder/
version: '3.5'
services:
  geth:
    image: ethereum/client-go:release-1.14
    container_name: geth
    volumes:
      - geth-data:/root/.ethereum
      - geth-ethash:/root/.ethash
    healthcheck:
      test: [ "CMD-SHELL", "geth attach --exec eth.blockNumber" ]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: always
    ports:
      - "127.0.0.1:8545:8545"
    command:
      - --http
      - --http.addr=0.0.0.0
      - --authrpc.addr=0.0.0.0
      - --authrpc.port=8551
      - --authrpc.vhosts=*
      - --syncmode=snap

  beacon-node:
    image: gcr.io/prysmaticlabs/prysm/beacon-chain:stable
    container_name: beacon-node
    depends_on:
      geth:
        condition: service_healthy
    volumes:
      - geth-data:/root/.ethereum
      - beacon-node-data:/root/.eth2
    restart: always
    ports:
      - "127.0.0.1:4000:4000"
      - "127.0.0.1:13000:13000"
      - "12000:12000/udp"
    command:
      - --accept-terms-of-use
      - --datadir=/root/.eth2
      - --jwt-secret=/root/.ethereum/geth/jwtsecret
      - --rpc-host=0.0.0.0
      - --grpc-gateway-host=0.0.0.0
      - --monitoring-host=0.0.0.0
      - --execution-endpoint=http://geth:8551
      - --checkpoint-sync-url=https://mainnet.checkpoint.sigp.io
      - --genesis-beacon-api-url=https://mainnet.checkpoint.sigp.io

volumes:
  geth-data:
  geth-ethash:
  beacon-node-data:
