Docker: remove the parameter 'P2P_PORT'

This commit is contained in:
Grégoire Henry 2018-03-07 11:31:42 +01:00
parent b8f8b598cd
commit 1903f081ab
3 changed files with 6 additions and 12 deletions

View File

@ -42,7 +42,7 @@ services:
node: node:
image: $docker_image image: $docker_image
hostname: node hostname: node
command: tezos-node $@ command: tezos-node --net-addr :$port $@
ports: ports:
- "$port:$port"$export_rpc - "$port:$port"$export_rpc
expose: expose:
@ -51,8 +51,6 @@ services:
- node_data:/var/run/tezos/node - node_data:/var/run/tezos/node
- client_data:/var/run/tezos/client - client_data:/var/run/tezos/client
restart: on-failure restart: on-failure
environment:
- P2P_PORT=$port
baker: baker:
image: $docker_image image: $docker_image

View File

@ -7,11 +7,11 @@ configure_client() {
if [ ! -f "$client_config" ]; then if [ ! -f "$client_config" ]; then
"$client" --base-dir "$client_dir" \ "$client" --base-dir "$client_dir" \
--addr "$NODE_HOST" --port "$RPC_PORT" \ --addr "$NODE_HOST" --port "$NODE_RPC_PORT" \
config init --output "$client_config" >/dev/null 2>&1 config init --output "$client_config" >/dev/null 2>&1
else else
"$client" --base-dir "$client_dir" \ "$client" --base-dir "$client_dir" \
--addr "$NODE_HOST" --port "$RPC_PORT" \ --addr "$NODE_HOST" --port "$NODE_RPC_PORT" \
config update >/dev/null 2>&1 config update >/dev/null 2>&1
fi fi
@ -49,15 +49,13 @@ launch_node() {
echo "Configuring the node..." echo "Configuring the node..."
"$node" config init \ "$node" config init \
--data-dir "$node_dir" \ --data-dir "$node_dir" \
--net-addr ":$P2P_PORT" \ --rpc-addr ":$NODE_RPC_PORT" \
--rpc-addr ":$RPC_PORT" \
"$@" "$@"
else else
echo "Updating the node configuration..." echo "Updating the node configuration..."
"$node" config update \ "$node" config update \
--data-dir "$node_dir" \ --data-dir "$node_dir" \
--net-addr ":$port" \ --rpc-addr ":$NODE_RPC_PORT" \
--rpc-addr ":$RPC_PORT" \
"$@" "$@"
fi fi

View File

@ -7,9 +7,7 @@ bin_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")"
: ${DATA_DIR:="/var/run/tezos"} : ${DATA_DIR:="/var/run/tezos"}
: ${NODE_HOST:="node"} : ${NODE_HOST:="node"}
: ${NODE_RPC_PORT:="8732"}
: ${P2P_PORT:="9732"}
: ${RPC_PORT:="8732"}
node="/usr/local/bin/tezos-node" node="/usr/local/bin/tezos-node"
client="/usr/local/bin/tezos-client" client="/usr/local/bin/tezos-client"