Skip to content

Commit

Permalink
Update docker config to use docker networking instead of host networking
Browse files Browse the repository at this point in the history
  • Loading branch information
mainnet-pat committed Sep 1, 2024
1 parent 9508cce commit 9ed3386
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 83 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ yarn-error.log*

# generated code
/src/protobuf/**

# docker data
docker/data
185 changes: 102 additions & 83 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ services:
envoy:
image: envoyproxy/envoy-dev:latest
container_name: envoy
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "8079:8079"
- "8080:8080"
- "8081:8081"
- "8082:8082"
- "8083:8083"
- "8084:8084"
- "8085:8085"
- "8086:8086"
- "127.0.0.1:8079:8079"
- "127.0.0.1:8080:8080"
- "127.0.0.1:8081:8081"
- "127.0.0.1:8082:8082"
- "127.0.0.1:8083:8083"
- "127.0.0.1:8084:8084"
- "127.0.0.1:8085:8085"
- "127.0.0.1:8086:8086"
volumes:
- ./../config/envoy.test.yaml:/config/envoy.test.yaml
command:
Expand All @@ -30,16 +28,22 @@ services:
"--no-igd",
"--hide-my-port",
"--data-dir=./.localnet/xmr_local/node1",
"--p2p-bind-ip=127.0.0.1",
"--p2p-bind-ip=0.0.0.0",
"--p2p-bind-port=48080",
"--confirm-external-bind",
"--rpc-bind-ip=0.0.0.0",
"--rpc-bind-port=48081",
"--no-zmq",
"--add-exclusive-node=127.0.0.1:28080",
"--rpc-access-control-origins=http://localhost:8080",
"--add-exclusive-node=node2:28080",
"--rpc-access-control-origins='*'",
"--fixed-difficulty=150",
"--non-interactive",
]
network_mode: "host"
ports:
- "127.0.0.1:48080:48080"
- "127.0.0.1:48081:48081"
# volumes:
# - ./data:/home/haveno/haveno/.localnet/xmr_local

node2:
build: haveno/
Expand All @@ -50,18 +54,24 @@ services:
"--no-igd",
"--hide-my-port",
"--data-dir=./.localnet/xmr_local/node2",
"--p2p-bind-ip=127.0.0.1",
"--p2p-bind-ip=0.0.0.0",
"--p2p-bind-port=28080",
"--confirm-external-bind",
"--rpc-bind-ip=0.0.0.0",
"--rpc-bind-port=28081",
"--no-zmq",
"--confirm-external-bind",
"--add-exclusive-node=127.0.0.1:48080",
"--rpc-access-control-origins=http://localhost:8080",
"--add-exclusive-node=node1:48080",
"--rpc-access-control-origins='*'",
"--fixed-difficulty=150",
"--non-interactive",
]
network_mode: "host"
ports:
- "127.0.0.1:28080:28080"
- "127.0.0.1:28081:28081"
depends_on:
- node1
# volumes:
# - ./data:/home/haveno/haveno/.localnet/xmr_local

seed1:
build: haveno/
Expand All @@ -73,11 +83,12 @@ services:
"--useDevPrivilegeKeys=true",
"--nodePort=2002",
"--appName=haveno-XMR_LOCAL_Seed1_2002",
"--xmrNode=http://localhost:28081"
"--xmrNode=http://node2:28081"
]
network_mode: "host"
depends_on:
- node2
ports:
- "127.0.0.1:2002:2002"

seed2:
build: haveno/
Expand All @@ -89,87 +100,95 @@ services:
"--useDevPrivilegeKeys=true",
"--nodePort=3002",
"--appName=haveno-XMR_LOCAL_Seed2_3002",
"--xmrNode=http://localhost:28081"
"--xmrNode=http://node2:28081"
]
network_mode: "host"
depends_on:
- node2
ports:
- "127.0.0.1:3002:3002"

arbitrator:
build: haveno/
container_name: arbitrator
entrypoint: [ "./haveno-daemon" ]
command: [
"--baseCurrencyNetwork=XMR_LOCAL",
"--useLocalhostForP2P=true",
"--useDevPrivilegeKeys=true",
"--nodePort=4444",
"--appName=haveno-XMR_LOCAL_arbitrator",
"--apiPassword=apitest",
"--apiPort=9998",
"--walletRpcBindPort=38090",
"--passwordRequired=false",
]
network_mode: "host"
depends_on:
- seed1
# arbitrator:
# build: haveno/
# container_name: arbitrator
# entrypoint: [ "./haveno-daemon" ]
# command: [
# "--baseCurrencyNetwork=XMR_LOCAL",
# "--useLocalhostForP2P=true",
# "--useDevPrivilegeKeys=true",
# "--nodePort=4444",
# "--appName=haveno-XMR_LOCAL_arbitrator",
# "--apiPassword=apitest",
# "--apiPort=9998",
# "--walletRpcBindPort=38090",
# "--passwordRequired=false",
# ]
# depends_on:
# - seed1
# # ports:
# # - "127.0.0.1:38090:38090"

user1:
build: haveno/
container_name: user1
entrypoint: [ "./haveno-daemon" ]
command: [
"--baseCurrencyNetwork=XMR_LOCAL",
"--useLocalhostForP2P=true",
"--useDevPrivilegeKeys=true",
"--nodePort=5555",
"--appName=haveno_user1",
"--apiPassword=apitest",
"--apiPort=9999",
"--walletRpcBindPort=38091",
"--passwordRequired=false",
]
network_mode: "host"
depends_on:
- seed1
# user1:
# build: haveno/
# container_name: user1
# entrypoint: [ "./haveno-daemon" ]
# command: [
# "--baseCurrencyNetwork=XMR_LOCAL",
# "--useLocalhostForP2P=true",
# "--useDevPrivilegeKeys=true",
# "--nodePort=5555",
# "--appName=haveno_user1",
# "--apiPassword=apitest",
# "--apiPort=9999",
# "--walletRpcBindPort=38091",
# "--passwordRequired=false",
# ]
# depends_on:
# - seed1
# # ports:
# # - "127.0.0.1:38091:38091"

user2:
build: haveno/
container_name: user2
entrypoint: [ "./haveno-daemon" ]
command: [
"--baseCurrencyNetwork=XMR_LOCAL",
"--useLocalhostForP2P=true",
"--useDevPrivilegeKeys=true",
"--nodePort=6666",
"--appName=haveno_user2",
"--apiPassword=apitest",
"--apiPort=10000",
"--walletRpcBindPort=38092",
"--passwordRequired=false",
]
network_mode: "host"
depends_on:
- seed1
# user2:
# build: haveno/
# container_name: user2
# entrypoint: [ "./haveno-daemon" ]
# command: [
# "--baseCurrencyNetwork=XMR_LOCAL",
# "--useLocalhostForP2P=true",
# "--useDevPrivilegeKeys=true",
# "--nodePort=6666",
# "--appName=haveno_user2",
# "--apiPassword=apitest",
# "--apiPort=10000",
# "--walletRpcBindPort=38092",
# "--passwordRequired=false",
# ]
# depends_on:
# - seed1
# # ports:
# # - "127.0.0.1:38092:38092"

pricenode:
build: pricenode/
container_name: pricenode
entrypoint: [ "./haveno-pricenode" ]
network_mode: "host"

funding:
build: haveno/
container_name: funding_wallet
entrypoint: [ "./.localnet/monero-wallet-rpc" ]
command: [
"--testnet",
"--daemon-address=http://localhost:28081",
"--daemon-address=http://node2:28081",
"--confirm-external-bind",
"--rpc-bind-ip=0.0.0.0",
"--rpc-bind-port=28084",
"--rpc-login=rpc_user:abc123",
"--rpc-access-control-origins=http://localhost:8080",
"--wallet-dir=./.localnet",
"--rpc-access-control-origins='*'",
"--wallet-dir=./.localnet/funding_wallet",
]
network_mode: "host"
depends_on:
- arbitrator
- node2
ports:
- "127.0.0.1:28084:28084"
# volumes:
# - ./data:/home/haveno/haveno/.localnet/funding_wallet

0 comments on commit 9ed3386

Please sign in to comment.