Skip to content

Commit

Permalink
Merge pull request eth-educators#894 from romanoLT/host-ip
Browse files Browse the repository at this point in the history
Set up docker's host ip
  • Loading branch information
yorickdowne authored Aug 22, 2022
2 parents 22ee293 + 7a0dab4 commit 0a27c17
Show file tree
Hide file tree
Showing 25 changed files with 51 additions and 46 deletions.
4 changes: 2 additions & 2 deletions akula.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ services:
- OVERRIDE_TTD=${OVERRIDE_TTD}
- LOG_LEVEL=${LOG_LEVEL}
ports:
- ${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
<<: *logging
entrypoint:
- docker-entrypoint.sh
Expand Down
4 changes: 2 additions & 2 deletions besu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ services:
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/besu/ee-secret
ports:
- ${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions blox-ssv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ services:
- ssv-data:/tmp
- /etc/localtime:/etc/localtime:ro
ports:
- ${SSV_P2P_PORT}:${SSV_P2P_PORT}/tcp
- ${SSV_P2P_PORT_UDP}:${SSV_P2P_PORT_UDP}/udp
- ${HOST_IP:-0.0.0.0}:${SSV_P2P_PORT}:${SSV_P2P_PORT}/tcp
- ${HOST_IP:-0.0.0.0}:${SSV_P2P_PORT_UDP}:${SSV_P2P_PORT_UDP}/udp
<<: *logging
environment:
- CONFIG_PATH=/config.yaml
Expand Down
2 changes: 1 addition & 1 deletion cl-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ version: "3.9"
services:
consensus:
ports:
- ${CL_REST_PORT:-5052}:${CL_REST_PORT:-5052}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_REST_PORT:-5052}:${CL_REST_PORT:-5052}/tcp
3 changes: 3 additions & 0 deletions default.env
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ EL_MIN_PEER_COUNT=
BEACON_STATS_API=
BEACON_STATS_MACHINE=

# IP of the host you want to use in Docker (in case host has several IPs)
HOST_IP=

# P2P ports you will forward to your staking node. Adjust here if you are
# going to use something other than defaults.
EL_P2P_PORT=30303
Expand Down
2 changes: 1 addition & 1 deletion ee-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ version: "3.9"
services:
execution:
ports:
- ${EE_PORT}:${EE_PORT:-8551}/tcp
- ${HOST_IP:-0.0.0.0}:${EE_PORT}:${EE_PORT:-8551}/tcp
4 changes: 2 additions & 2 deletions el-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ version: "3.9"
services:
execution:
ports:
- ${EL_RPC_PORT}:${EL_RPC_PORT:-8545}/tcp
- ${EL_WS_PORT}:${EL_WS_PORT:-8546}/tcp
- ${HOST_IP:-0.0.0.0}:${EL_RPC_PORT}:${EL_RPC_PORT:-8545}/tcp
- ${HOST_IP:-0.0.0.0}:${EL_WS_PORT}:${EL_WS_PORT:-8546}/tcp
8 changes: 4 additions & 4 deletions erigon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ services:
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/erigon/ee-secret
ports:
- ${EL_P2P_PORT-30303}:${EL_P2P_PORT:-30303}/tcp
- ${EL_P2P_PORT-30303}:${EL_P2P_PORT:-30303}/udp
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT-30303}:${EL_P2P_PORT:-30303}/tcp
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT-30303}:${EL_P2P_PORT:-30303}/udp
# torrent ports
- ${ERIGON_TORRENT_PORT:-42069}:${ERIGON_TORRENT_PORT:-42069}/tcp
- ${ERIGON_TORRENT_PORT:-42069}:${ERIGON_TORRENT_PORT:-42069}/udp
- ${HOST_IP:-0.0.0.0}:${ERIGON_TORRENT_PORT:-42069}:${ERIGON_TORRENT_PORT:-42069}/tcp
- ${HOST_IP:-0.0.0.0}:${ERIGON_TORRENT_PORT:-42069}:${ERIGON_TORRENT_PORT:-42069}/udp
networks:
default:
aliases:
Expand Down
6 changes: 4 additions & 2 deletions ethd
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ envmigrate() {
ALL_VARS=( COMPOSE_FILE FEE_RECIPIENT EL_NODE GRAFFITI NETWORK MEV_BOOST MEV_RELAYS OVERRIDE_TTD \
CL_MAX_PEER_COUNT CL_MIN_PEER_COUNT EL_MAX_PEER_COUNT EL_MIN_PEER_COUNT DOMAIN ACME_EMAIL \
CF_EMAIL CF_API_TOKEN AWS_PROFILE AWS_HOSTED_ZONE_ID GRAFANA_HOST DISTRIBUTED \
PROM_HOST PRYSM_HOST EE_HOST EL_HOST EL_LB EL_WS_HOST EL_WS_LB CL_HOST CL_LB DDNS_SUBDOMAIN DDNS_PROXY RAPID_SYNC_URL \
PROM_HOST HOST_IP PRYSM_HOST EE_HOST EL_HOST EL_LB EL_WS_HOST EL_WS_LB CL_HOST CL_LB DDNS_SUBDOMAIN DDNS_PROXY RAPID_SYNC_URL \
CL_NODE BEACON_STATS_API BEACON_STATS_MACHINE EL_P2P_PORT CL_P2P_PORT PRYSM_PORT DOPPELGANGER \
PRYSM_UDP_PORT GRAFANA_PORT KEY_API_PORT TRAEFIK_WEB_PORT TRAEFIK_WEB_HTTP_PORT CL_REST_PORT \
EL_RPC_PORT EL_WS_PORT EE_PORT ERIGON_TORRENT_PORT LOG_LEVEL JWT_SECRET GETH_CACHE SSV_P2P_PORT SSV_P2P_PORT_UDP )
Expand All @@ -350,7 +350,7 @@ envmigrate() {
OLD_VARS=( LH_PORT PRYSM_WEB_PORT EC_NODE REWARDS_TO \
EC_HOST EC_LB EC_WS_HOST EC_WS_LB CC_HOST CC_LB EC_P2P_PORT CC_NODE CC_P2P_PORT EC_RPC_PORT EC_WS_PORT )
NEW_VARS=( CL_P2P_PORT KEY_API_PORT EL_NODE FEE_RECIPIENT \
EL_HOST EL_LB EL_WS_HOST EL_WS_LB CL_HOST CL_LB EL_P2P_PORT CL_NODE CL_P2P_PORT EL_RPC_PORT EL_WS_PORT )
EL_HOST EL_LB EL_WS_HOST EL_WS_LB CL_HOST CL_LB EL_P2P_PORT CL_NODE CL_P2P_PORT EL_RPC_PORT EL_WS_PORT HOST_IP)

if [ "${EUID}" -eq 0 ]; then
# Previous version of this tool when run as root may have created a root-owned .env.bak
Expand Down Expand Up @@ -1314,6 +1314,8 @@ config () {
set_value_in_env
var=GRAFFITI
set_value_in_env
var=HOST_IP
set_value_in_env
var=CL_NODE
set_value_in_env
var=RAPID_SYNC_URL
Expand Down
4 changes: 2 additions & 2 deletions geth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ services:
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/goethereum/ee-secret
ports:
- ${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
networks:
default:
aliases:
Expand Down
2 changes: 1 addition & 1 deletion grafana-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.9"
services:
grafana:
ports:
- ${GRAFANA_PORT}:${GRAFANA_PORT}/tcp
- ${HOST_IP:-0.0.0.0}:${GRAFANA_PORT}:${GRAFANA_PORT}/tcp
# prometheus:
# ports:
# - 9090:9090/tcp
4 changes: 2 additions & 2 deletions lighthouse-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ services:
- BEACON_STATS_MACHINE=${BEACON_STATS_MACHINE}
- MALLOC_ARENA_MAX=4
ports:
- ${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ services:
- BEACON_STATS_MACHINE=${BEACON_STATS_MACHINE}
- MALLOC_ARENA_MAX=4
ports:
- ${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions lodestar-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ services:
- OVERRIDE_TTD=${OVERRIDE_TTD}
- MEV_BOOST=${MEV_BOOST}
ports:
- ${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
<<: *logging
entrypoint:
- docker-entrypoint.sh
Expand Down
4 changes: 2 additions & 2 deletions lodestar-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ services:
- OVERRIDE_TTD=${OVERRIDE_TTD}
- MEV_BOOST=${MEV_BOOST}
ports:
- ${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
<<: *logging
entrypoint:
- docker-entrypoint.sh
Expand Down
4 changes: 2 additions & 2 deletions nethermind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ services:
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/nethermind/ee-secret
ports:
- ${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions nimbus-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ services:
- MEV_BOOST=${MEV_BOOST}
- DOPPELGANGER=${DOPPELGANGER}
ports:
- ${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions nimbus-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ services:
- OVERRIDE_TTD=${OVERRIDE_TTD}
- MEV_BOOST=${MEV_BOOST}
ports:
- ${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions prysm-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ services:
- OVERRIDE_TTD=${OVERRIDE_TTD}
- MEV_BOOST=${MEV_BOOST}
ports:
- ${PRYSM_PORT}:${PRYSM_PORT}/tcp
- ${PRYSM_UDP_PORT}:${PRYSM_UDP_PORT}/udp
- ${HOST_IP:-0.0.0.0}:${PRYSM_PORT}:${PRYSM_PORT}/tcp
- ${HOST_IP:-0.0.0.0}:${PRYSM_UDP_PORT}:${PRYSM_UDP_PORT}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions prysm-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ services:
- OVERRIDE_TTD=${OVERRIDE_TTD}
- MEV_BOOST=${MEV_BOOST}
ports:
- ${PRYSM_PORT}:${PRYSM_PORT}/tcp
- ${PRYSM_UDP_PORT}:${PRYSM_UDP_PORT}/udp
- ${HOST_IP:-0.0.0.0}:${PRYSM_PORT}:${PRYSM_PORT}/tcp
- ${HOST_IP:-0.0.0.0}:${PRYSM_UDP_PORT}:${PRYSM_UDP_PORT}/udp
networks:
default:
aliases:
Expand Down
2 changes: 1 addition & 1 deletion prysm-web-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ version: "3.9"
services:
validator:
ports:
- ${KEY_API_PORT:-7500}:${KEY_API_PORT:-7500}/tcp
- ${HOST_IP:-0.0.0.0}:${KEY_API_PORT:-7500}:${KEY_API_PORT:-7500}/tcp
4 changes: 2 additions & 2 deletions teku-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ services:
- OVERRIDE_TTD=${OVERRIDE_TTD}
- MEV_BOOST=${MEV_BOOST}
ports:
- ${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions teku-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ services:
- OVERRIDE_TTD=${OVERRIDE_TTD}
- MEV_BOOST=${MEV_BOOST}
ports:
- ${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions traefik-aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ services:
- --entrypoints.web.http.redirections.entrypoint.scheme=https
- --entrypoints.websecure.address=:${TRAEFIK_WEB_PORT}
ports:
- ${TRAEFIK_WEB_PORT}:${TRAEFIK_WEB_PORT}/tcp
- ${TRAEFIK_WEB_HTTP_PORT}:${TRAEFIK_WEB_HTTP_PORT}/tcp
- ${HOST_IP:-0.0.0.0}:${TRAEFIK_WEB_PORT}:${TRAEFIK_WEB_PORT}/tcp
- ${HOST_IP:-0.0.0.0}:${TRAEFIK_WEB_HTTP_PORT}:${TRAEFIK_WEB_HTTP_PORT}/tcp
environment:
- AWS_PROFILE=${AWS_PROFILE}
- AWS_HOSTED_ZONE_ID=${AWS_HOSTED_ZONE_ID}
Expand Down
4 changes: 2 additions & 2 deletions traefik-cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ services:
- --entrypoints.web.http.redirections.entrypoint.scheme=https
- --entrypoints.websecure.address=:${TRAEFIK_WEB_PORT}
ports:
- ${TRAEFIK_WEB_PORT}:${TRAEFIK_WEB_PORT}/tcp
- ${TRAEFIK_WEB_HTTP_PORT}:${TRAEFIK_WEB_HTTP_PORT}/tcp
- ${HOST_IP:-0.0.0.0}:${TRAEFIK_WEB_PORT}:${TRAEFIK_WEB_PORT}/tcp
- ${HOST_IP:-0.0.0.0}:${TRAEFIK_WEB_HTTP_PORT}:${TRAEFIK_WEB_HTTP_PORT}/tcp
environment:
- CLOUDFLARE_EMAIL=${CF_EMAIL}
- CLOUDFLARE_DNS_API_TOKEN=${CF_API_TOKEN}
Expand Down

0 comments on commit 0a27c17

Please sign in to comment.