feat(frontend/A): 嵌入方案A前端构建产物并简化构建流程 - 用户管理增强UI(批量/CSV导入) + 登录审计页面 - 修正 inventory/loginaudit.go List 加 WithUser() 加载 edges.user - 修正 version.json version=4.14.0 匹配 BackendVersion - Dockerfile.ci 删除 Stage1,直接 embed application/statics/assets.zip - .gitignore 放行 assets.zip,忽略前端临时目录 frontend-temp/ - 新增 scripts/gitea_actions.mjs 辅助 Actions status/dispatch
Build and Deploy / build-and-deploy (push) Canceled after 0s

This commit is contained in:
2026-09-13 12:57:03 +08:00
parent 0959d10f35
commit 8e956f3c39
5 changed files with 93 additions and 33 deletions
+2 -32
View File
@@ -1,38 +1,9 @@
# syntax=docker/dockerfile:1.6
ARG FRONTEND_MIRROR=https://gitclone.com/github.com/cloudreve/frontend.git
ARG GO_PROXY=https://goproxy.cn,direct
ARG NPM_REGISTRY=https://registry.npmmirror.com
# ========================================
# Stage 1: Frontend build
# ========================================
FROM node:20-alpine AS frontend-build
ARG FRONTEND_MIRROR
ARG NPM_REGISTRY
WORKDIR /build
RUN apk add --no-cache git zip tzdata
RUN --mount=type=cache,target=/tmp/git-cache \
git clone --depth 1 ${FRONTEND_MIRROR} assets
WORKDIR /build/assets
RUN npm config set registry ${NPM_REGISTRY} && \
yarn config set registry ${NPM_REGISTRY}
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn \
--mount=type=cache,target=/build/assets/node_modules \
yarn install --network-timeout 1000000 --frozen-lockfile || yarn install --network-timeout 1000000
RUN export NODE_OPTIONS="--max-old-space-size=8192" && yarn run build
WORKDIR /build
RUN mkdir -p application/statics && \
cd assets/build && zip -r - . > /build/application/statics/assets.zip
# ========================================
# Stage 2: Backend build
# Stage 1: Backend build (frontend pre-built locally -> application/statics/assets.zip)
# ========================================
FROM golang:1.23-alpine AS backend-build
ARG GO_PROXY
@@ -50,7 +21,6 @@ RUN --mount=type=cache,target=/go/pkg/mod \
go mod download
COPY . .
COPY --from=frontend-build /build/application/statics/assets.zip ./application/statics/assets.zip
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
@@ -61,7 +31,7 @@ RUN --mount=type=cache,target=/go/pkg/mod \
go build -trimpath -ldflags "-s -w -X 'github.com/cloudreve/Cloudreve/v4/pkg/conf.BackendVersion=byw-${BUILD_DATE:-dev}'" -o /cloudreve .
# ========================================
# Stage 3: Runtime image
# Stage 2: Runtime image
# ========================================
FROM alpine:latest AS runtime