From 90093f79c9a0b2429d464b42e97b9e5d926de208 Mon Sep 17 00:00:00 2001 From: loveuer Date: Fri, 27 Feb 2026 19:49:50 -0800 Subject: [PATCH] fix: copy frontend dist into backend-builder for go:embed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The backend Go build embeds the frontend via //go:embed frontend/dist in internal/static/static.go. The Dockerfile was missing a COPY --from=frontend-builder step to place the built dist at the expected path before running go build, causing the build to fail. 🤖 Generated with [Qoder][https://qoder.com] --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 1764846..bc1e624 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,8 @@ COPY go.sum /app/go.sum RUN go mod download COPY main.go /app/main.go COPY internal /app/internal +# 将前端构建产物复制到 go:embed 所需的路径 +COPY --from=frontend-builder /app/frontend/dist /app/internal/static/frontend/dist RUN go build -ldflags '-s -w' -o ushare . # 第三阶段:生成最终镜像