fix: copy frontend dist into backend-builder for go:embed
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]
This commit is contained in:
@@ -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 .
|
||||
|
||||
# 第三阶段:生成最终镜像
|
||||
|
||||
Reference in New Issue
Block a user