diff --git a/bsc/docker-compose.no-proxy.yml b/bsc/docker-compose.no-proxy.yml index c0cb503..5dbe556 100644 --- a/bsc/docker-compose.no-proxy.yml +++ b/bsc/docker-compose.no-proxy.yml @@ -6,12 +6,14 @@ services: container_name: bsc-pruning entrypoint: - bsc + - --datadir + - "/bsc/.ethereum" - snapshot - prune-state restart: "no" volumes: - - ./bsc-data:/root/.ethereum - - ./config.toml:/root/.ethereum/config.toml + - ./bsc-data:/bsc/.ethereum + - ./config.toml:/bsc/config/config.toml bsc: image: bsc:local @@ -24,8 +26,10 @@ services: entrypoint: - docker-entrypoint.sh - bsc + - --datadir + - "/bsc/.ethereum" - --config - - "/root/.ethereum/config.toml" + - "/bsc/config/config.toml" - --port - "${P2P_PORT}" - --rpc.allow-unprotected-txs @@ -62,5 +66,5 @@ services: - ${WS_PORT}:${WS_PORT} - ${P2P_PORT}:${P2P_PORT} volumes: - - ./bsc-data:/root/.ethereum - - ./config.toml:/root/.ethereum/config.toml + - ./bsc-data:/bsc/.ethereum + - ./config.toml:/bsc/config/config.toml diff --git a/bsc/docker-compose.yml b/bsc/docker-compose.yml index 60000dc..04752ed 100644 --- a/bsc/docker-compose.yml +++ b/bsc/docker-compose.yml @@ -6,12 +6,14 @@ services: container_name: bsc-pruning entrypoint: - bsc + - --datadir + - "/bsc/.ethereum" - snapshot - prune-state restart: "no" volumes: - - ./bsc-data:/root/.ethereum - - ./config.toml:/root/.ethereum/config.toml + - ./bsc-data:/bsc/.ethereum + - ./config.toml:/bsc/config/config.toml bsc: image: bsc:local @@ -24,8 +26,10 @@ services: entrypoint: - docker-entrypoint.sh - bsc + - --datadir + - "/bsc/.ethereum" - --config - - "/root/.ethereum/config.toml" + - "/bsc/config/config.toml" - --port - "${P2P_PORT}" - --rpc.allow-unprotected-txs @@ -66,8 +70,8 @@ services: # - ${WS_PORT}:${WS_PORT} - ${P2P_PORT}:${P2P_PORT} volumes: - - ./bsc-data:/root/.ethereum - - ./config.toml:/root/.ethereum/config.toml + - ./bsc-data:/bsc/.ethereum + - ./config.toml:/bsc/config/config.toml labels: - "traefik.enable=true" - "traefik.http.routers.bsc-http.middlewares=bsc-http-acl" diff --git a/bsc/docker-entrypoint.sh b/bsc/docker-entrypoint.sh index dfb17f1..06f036e 100755 --- a/bsc/docker-entrypoint.sh +++ b/bsc/docker-entrypoint.sh @@ -1,11 +1,11 @@ #!/bin/sh set -x -if [ ! -f /root/.ethereum/setupdone ]; then - wget -O /root/mainnet.zip "https://github.com/bnb-chain/bsc/releases/download/${BSC_TAG}/mainnet.zip" - unzip -o -j /root/mainnet.zip "mainnet/genesis.json" -d /root/.ethereum/ - bsc init /root/.ethereum/genesis.json - touch /root/.ethereum/setupdone +if [ ! -f /bsc/config/setupdone ]; then + wget -O /bsc/mainnet.zip "https://github.com/bnb-chain/bsc/releases/download/${BSC_TAG}/mainnet.zip" + unzip -o -j /bsc/mainnet.zip "mainnet/genesis.json" -d /bsc/config/ + bsc --datadir /bsc/.ethereum init /bsc/config/genesis.json + touch /bsc/config/setupdone fi exec "$@" \ No newline at end of file