From bc014933a41163591fc447ee1e9fefc15cefea7b Mon Sep 17 00:00:00 2001 From: kale Date: Mon, 8 Dec 2025 04:43:25 -0500 Subject: [PATCH] =?UTF-8?q?[fix]:[20251208][drone=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=B7=A5=E7=A8=8B=E7=9A=84cicd=208]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 2 ++ docker/Dockerfile-frontend | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index b69126e..03aca2f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -179,6 +179,8 @@ steps: - name: docker_sock path: /var/run/docker.sock commands: + - cp /localcache/${DRONE_REPO_NAME}/dist-${DRONE_TAG}.tgz dist.tgz + - ls -lh dist.tgz - docker info - docker build -t ${DRONE_REPO_NAME}-frontend:latest -f docker/Dockerfile-frontend . - docker tag ${DRONE_REPO_NAME}-frontend:latest ${DRONE_REPO_NAME}-frontend:${DRONE_COMMIT_SHA:0:8} diff --git a/docker/Dockerfile-frontend b/docker/Dockerfile-frontend index ae7b17d..e145685 100644 --- a/docker/Dockerfile-frontend +++ b/docker/Dockerfile-frontend @@ -7,12 +7,12 @@ WORKDIR /app COPY vue-ui/package*.json ./ # 使用国内镜像源并安装依赖 -RUN npm config set registry https://registry.npmmirror.com \ - && npm ci --no-audit --no-fund +# RUN npm config set registry https://registry.npmmirror.com \ +# && npm ci --no-audit --no-fund # 复制源码并构建 COPY vue-ui/ . -RUN npm run build +# RUN npm run build # 运行阶段,使用独立 nginx 镜像 FROM registry.cn-beijing.aliyuncs.com/yinzy/nginx:latest AS runtime @@ -22,7 +22,8 @@ WORKDIR /usr/share/nginx/html RUN rm -rf ./* # 拷贝构建产物 -COPY --from=builder /app/dist . +# 直接使用构建上下文中的 dist.tgz +ADD dist.tgz . EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file -- 2.47.2