ci(docker): 添加平台配置以支持多架构构建
添加 PLATFORM 环境变量配置,允许在 docker-compose 和部署脚本中指定构建平台
This commit is contained in:
parent
c62e98ae90
commit
3453570dc6
|
|
@ -1,6 +1,7 @@
|
|||
services:
|
||||
msdt:
|
||||
build: .
|
||||
platform: ${PLATFORM:-linux/amd64}
|
||||
container_name: msdt
|
||||
environment:
|
||||
- APP_ENV=${APP_ENV:-prod}
|
||||
|
|
|
|||
|
|
@ -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 <env> <image> [up|down|restart|logs]" >&2
|
||||
exit 1 ;;
|
||||
esac
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue