From 1b943d23b4b5eb6ef35de4b908a53b702964ba1c Mon Sep 17 00:00:00 2001 From: Wesley Yan <39544037+wesleyylg928392839@users.noreply.github.com> Date: Thu, 29 Jan 2026 19:07:09 +0100 Subject: [PATCH] Update docker-compose.yml Made Docker startup less flaky by adding healthchecks and gating node startup on execution being healthy. --- docker-compose.yml | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index fc7cebe1d..5d5c0746e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,29 +5,43 @@ services: dockerfile: ${CLIENT:-geth}/Dockerfile restart: unless-stopped ports: - - "8545:8545" # RPC - - "8546:8546" # websocket - - "7301:6060" # metrics - - "30303:30303" # P2P TCP - - "30303:30303/udp" # P2P UDP + - "8545:8545" + - "8546:8546" + - "7301:6060" + - "30303:30303" + - "30303:30303/udp" command: ["bash", "./execution-entrypoint"] volumes: - ${HOST_DATA_DIR}:/data env_file: - - ${NETWORK_ENV:-.env.mainnet} # Use .env.mainnet by default, override with .env.sepolia for testnet + - ${NETWORK_ENV:-.env.mainnet} + healthcheck: + test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:6060/debug/pprof/ >/dev/null 2>&1 || exit 1"] + interval: 10s + timeout: 3s + retries: 12 + start_period: 20s + node: build: context: . dockerfile: ${CLIENT:-geth}/Dockerfile restart: unless-stopped depends_on: - - execution + execution: + condition: service_healthy ports: - - "7545:8545" # RPC - - "9222:9222" # P2P TCP - - "9222:9222/udp" # P2P UDP - - "7300:7300" # metrics - - "6060:6060" # pprof + - "7545:8545" + - "9222:9222" + - "9222:9222/udp" + - "7300:7300" + - "6060:6060" command: ["bash", "./op-node-entrypoint"] env_file: - - ${NETWORK_ENV:-.env.mainnet} # Use .env.mainnet by default, override with .env.sepolia for testnet + - ${NETWORK_ENV:-.env.mainnet} + healthcheck: + test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:6060/debug/pprof/ >/dev/null 2>&1 || exit 1"] + interval: 10s + timeout: 3s + retries: 12 + start_period: 20s