From 3453570dc6fbf66bb7b6e19db58f650876145126 Mon Sep 17 00:00:00 2001 From: zhouyonggao <1971162852@qq.com> Date: Fri, 28 Nov 2025 16:14:25 +0800 Subject: [PATCH] =?UTF-8?q?ci(docker):=20=E6=B7=BB=E5=8A=A0=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E9=85=8D=E7=BD=AE=E4=BB=A5=E6=94=AF=E6=8C=81=E5=A4=9A?= =?UTF-8?q?=E6=9E=B6=E6=9E=84=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加 PLATFORM 环境变量配置,允许在 docker-compose 和部署脚本中指定构建平台 --- docker-compose.yml | 1 + scripts/deploy_image.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 259e0e3..a93bf75 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,7 @@ services: msdt: build: . + platform: ${PLATFORM:-linux/amd64} container_name: msdt environment: - APP_ENV=${APP_ENV:-prod} diff --git a/scripts/deploy_image.sh b/scripts/deploy_image.sh index e3b46ee..7949597 100644 --- a/scripts/deploy_image.sh +++ b/scripts/deploy_image.sh @@ -4,6 +4,7 @@ set -euo pipefail ENV=${1:-test} IMAGE=${2:-marketingsystemdatatool_msdt:latest} CMD=${3:-up} +PLATFORM=${PLATFORM:-linux/amd64} ROOT_DIR=$(cd "$(dirname "$0")/.." && pwd) @@ -17,6 +18,7 @@ case "$CMD" in up) docker rm -f msdt >/dev/null 2>&1 || true docker run -d --name msdt \ + --platform "$PLATFORM" \ -p 8077:8077 \ -e APP_ENV="$ENV" \ -e MARKETING_DB_HOST="${MARKETING_DB_HOST:-}" \ @@ -41,4 +43,3 @@ case "$CMD" in echo "usage: deploy_image.sh [up|down|restart|logs]" >&2 exit 1 ;; esac -