From 2393a281c356b7a61fbecbe2f001f78a439e5190 Mon Sep 17 00:00:00 2001 From: Slawomir Koszewski Date: Fri, 27 Feb 2026 13:33:21 +0100 Subject: [PATCH] fix: streamline port exposure handling in run script --- entrypoint.sh | 3 --- run.sh | 18 ++++++++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 5ccb02f..f4fc28e 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -89,7 +89,6 @@ fi CADDY=true AZURITE_SSL="" CERT_ARGS=() -BLOB_ARGS=() OAUTH_ARGS=() while [[ $# -gt 0 ]]; do @@ -143,7 +142,6 @@ else # If not using Caddy, configure Azurite to listen on all interfaces and use the generated self-signed certificate. # This mode does not require Caddy, but it will not allow simultaneous access to the table and queue services on the same HTTPS port. if [[ -n "$AZURITE_SSL" ]]; then - BLOB_ARGS=("--blobHost" "0.0.0.0" "--blobPort" "443") CERT_ARGS=("--key" "$AZURITE_DIR/${ACCOUNT_NAME}_key.pem" "--cert" "$AZURITE_DIR/${ACCOUNT_NAME}_cert.pem") fi fi @@ -152,5 +150,4 @@ exec node /app/azurite/src/azurite.js \ --disableTelemetry \ --location "$AZURITE_DIR" \ "${CERT_ARGS[@]}" \ - "${BLOB_ARGS[@]}" \ "${OAUTH_ARGS[@]}" diff --git a/run.sh b/run.sh index 6dcc540..f806d02 100755 --- a/run.sh +++ b/run.sh @@ -1,8 +1,22 @@ #!/usr/bin/env bash + +EXPOSED_PORTS=("-p" "443:443") +OAUTH_ENABLED="" + +while [[ $# -gt 0 ]]; do + case "$1" in + --oauth) + OAUTH_ENABLED=true + EXPOSED_PORTS=("-p" "443:10000" "-p" "10001:10001" "-p" "10002:10002") + shift + ;; + esac +done + if command -v dockerd &> /dev/null; then - docker run --rm -it --name azurite --env-file accounts.env -p 443:443 -v ./storage:/storage azurite:latest "$@" + docker run --rm -it --name azurite --env-file accounts.env "${EXPOSED_PORTS[@]}" -v ./storage:/storage azurite:latest "$@" elif command -v container &> /dev/null; then - container run --rm -it --name azurite --env-file accounts.env -p 443:443 --mount type=bind,source=./storage,target=/storage azurite:latest "$@" + container run --rm -it --name azurite --env-file accounts.env "${EXPOSED_PORTS[@]}" --mount type=bind,source=./storage,target=/storage azurite:latest "$@" else echo "Neither supported container runtime found." >&2 exit 1