Merge pull request #7255 from dokku/7251-publish-once

This commit is contained in:
Jose Diaz-Gonzalez authored and GitHub committed 2024-10-09 08:34:35 -04:00
commit d1c79b8cd6
1 file changed
+7
@@ -34,6 +34,7 @@ main() {
local DOKKU_PORT="" local DOKKU_PORT=""
if [[ "$PROC_TYPE" == "web" ]]; then if [[ "$PROC_TYPE" == "web" ]]; then
ports=($(plugn trigger ports-get "$APP")) ports=($(plugn trigger ports-get "$APP"))
local exposed_ports=()
for port_map in "${ports[@]}"; do for port_map in "${ports[@]}"; do
local scheme="$(echo "$port_map" | cut -d':' -f1)" local scheme="$(echo "$port_map" | cut -d':' -f1)"
local container_port="$(echo "$port_map" | cut -d':' -f3)" local container_port="$(echo "$port_map" | cut -d':' -f3)"
@@ -41,7 +42,13 @@ main() {
DOKKU_PORT="${DOKKU_PORT:="$container_port"}" DOKKU_PORT="${DOKKU_PORT:="$container_port"}"
fi fi
# skip if the exposed_ports array contains container_port
if fn-in-array "$container_port" "${exposed_ports[@]}"; then
continue
fi
if [[ "$DOKKU_NETWORK_BIND_ALL" == "true" ]]; then if [[ "$DOKKU_NETWORK_BIND_ALL" == "true" ]]; then
exposed_ports+=("$container_port")
DOCKER_ARGS+=" -p $container_port" DOCKER_ARGS+=" -p $container_port"
fi fi
done done