diff --git a/Dockerfile b/Dockerfile index 7d8fb13..6b89dd4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,8 +51,10 @@ COPY backend/ ./ # Copy frontend dist from previous stage COPY --from=frontend-builder /app/frontend/dist ./internal/web/dist -# Build the binary with embed tag -RUN GOTOOLCHAIN=auto CGO_ENABLED=1 GOOS=linux go build \ +# Build the binary with embed tag (使用缓存加速) +RUN --mount=type=cache,target=/root/.cache/go-build \ + --mount=type=cache,target=/go/pkg/mod \ + GOTOOLCHAIN=auto CGO_ENABLED=1 GOOS=linux go build \ -tags embed \ -ldflags="-s -w" \ -o /app/codex-pool \