services: eth-rpc: platform: linux/amd64 build: context: . dockerfile: dockerfile image: revive-eth-rpc container_name: revive-eth-rpc restart: unless-stopped stop_grace_period: 10s environment: RUST_LOG: "info,eth-rpc=debug,error" RUST_BACKTRACE: "1" ports: - "127.0.0.1:8545:8545" command: - "--node-rpc-url" - "wss://paseo-asset-hub-next-rpc.polkadot.io" - "--rpc-port" - "8545" - "--rpc-external" # The port is published on host loopback only (`127.0.0.1:8545:8545`). # Restrict CORS to local origins so a browser tab on a non-loopback # host cannot drive the local RPC. `forge` / `bun` / `cast` invoke # the RPC server-side and don't need CORS. - "--rpc-cors" - "http://localhost,http://127.0.0.1" - "--eth-pruning" - "1" - "--rpc-max-connections" - "500" - "--rpc-max-request-size" - "50" - "--rpc-max-response-size" - "50" healthcheck: test: - "CMD-SHELL" - >- curl -fsS -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' http://localhost:8545 > /dev/null interval: 15s timeout: 5s retries: 3 start_period: 60s deploy: resources: limits: memory: 4G reservations: memory: 1G