From 427af97793c24bf6c6630a54e2b8af56f1bb586e Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Mon, 17 Feb 2025 18:14:45 +0800
Subject: [PATCH] 修改

---
 Dockerfile |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 7762792..5c64526 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -14,4 +14,14 @@
 RUN npm run build-only
 
 # 查看
-RUN ls /app/dist
\ No newline at end of file
+RUN ls /app/dist
+
+# 创建一个新的镜像阶段,用于最终镜像的构建
+FROM alpine:latest AS final-image
+ 
+# 创建一个目录来存放打包后的文件
+RUN mkdir -p /app/dist-final
+ 
+# 将构建阶段中的打包文件拷贝到最终镜像的指定目录
+# 注意:这里使用了 `--from=build-env` 来引用前面的构建阶段
+COPY --from=build-env /app/dist /app/dist-final
\ No newline at end of file

--
Gitblit v1.9.3