From 1e4142371565b2544873fcf62ba9fd8e575c51d1 Mon Sep 17 00:00:00 2001 From: winter Date: Thu, 10 Jul 2025 15:19:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=20release.sh=20?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.override.yml | 2 +- release.sh | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100755 release.sh diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 0751abe90..1fffd3aac 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -10,7 +10,7 @@ services: volumes: - /var/run/docker.sock:/var/run/docker.sock ports: - - "80:80" + - "8089:80" - "8090:8080" # Duplicate the command from docker-compose.yml to add --api.insecure=true command: diff --git a/release.sh b/release.sh new file mode 100755 index 000000000..f555f7a3f --- /dev/null +++ b/release.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -e + +# === 配置 === +USER=fewinter # 你的 Docker Hub 用户名 +BACKEND_DIR=./backend +FRONTEND_DIR=./frontend +BACKEND_IMAGE=$USER/fastapi-backend +FRONTEND_IMAGE=$USER/fastapi-frontend +TAG=${1:-latest} # 默认 tag 是 latest,传参可覆盖 + +# === 构建并推送 === +echo "▶ Building and pushing backend..." +docker buildx build --platform linux/amd64 -t $BACKEND_IMAGE:$TAG $BACKEND_DIR --push + +echo "▶ Building and pushing frontend..." +docker buildx build --platform linux/amd64 -t $FRONTEND_IMAGE:$TAG $FRONTEND_DIR --push + +echo "✅ Release completed: $TAG"