fix(deploy): bind development ports to loopback

This commit is contained in:
2026-08-25 11:39:12 +08:00
parent 68bdc3e6bb
commit 6ba4537d3d
5 changed files with 39 additions and 15 deletions
+12
View File
@@ -36,6 +36,13 @@ case "$DEPLOY_ENV" in
;;
esac
if [ "$DEPLOY_ENV" = "development" ]; then
PUBLISHED_BIND_ADDRESS=127.0.0.1
else
PUBLISHED_BIND_ADDRESS="${PUBLISHED_BIND_ADDRESS:-0.0.0.0}"
fi
export PUBLISHED_BIND_ADDRESS
case "$SERVICE" in
*[!A-Za-z0-9_-]*|'')
echo "非法服务名: $SERVICE" >&2
@@ -390,6 +397,11 @@ cd "$remote_dir"
export DEPLOY_ENV="$deploy_env"
export IMAGE_REPOSITORY="$image_repository"
export IMAGE_TAG="$image_tag"
if [ "$deploy_env" = "development" ]; then
export PUBLISHED_BIND_ADDRESS=127.0.0.1
else
export PUBLISHED_BIND_ADDRESS="${PUBLISHED_BIND_ADDRESS:-0.0.0.0}"
fi
compose() {
docker compose \
@@ -64,6 +64,7 @@ if [ "${DEVELOPMENT_DEPLOY_LOCAL:-false}" = "true" ]; then
cd "$REMOTE_DIR"
export DEPLOY_ENV=development
export IMAGE_REPOSITORY IMAGE_TAG
export PUBLISHED_BIND_ADDRESS=127.0.0.1
docker compose \
--project-name "$PROJECT_NAME" \
@@ -143,6 +144,7 @@ cd "$remote_dir"
export DEPLOY_ENV=development
export IMAGE_REPOSITORY="$image_repository"
export IMAGE_TAG="$image_tag"
export PUBLISHED_BIND_ADDRESS=127.0.0.1
docker compose \
--project-name "$project_name" \