feat(admin): 运营后台(登录/查看/审核编辑/补全)+ 写入API + 审计留痕
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
# Admin console image: builds the SPA (node), embeds it into the Go admin
|
||||
# binary, and ships a static scratch runtime. Build context is the repo root.
|
||||
|
||||
# Stage 1: build the admin SPA.
|
||||
FROM node:22-alpine AS web
|
||||
WORKDIR /web
|
||||
COPY admin-frontend/package.json admin-frontend/package-lock.json* ./
|
||||
RUN npm ci || npm install
|
||||
COPY admin-frontend/ ./
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: build the Go admin binary with the SPA embedded.
|
||||
FROM golang:1.23-alpine AS build
|
||||
ENV GOPROXY=https://goproxy.cn,direct
|
||||
WORKDIR /src
|
||||
COPY api/go.mod api/go.sum ./
|
||||
RUN go mod download
|
||||
COPY api/ ./
|
||||
RUN rm -rf internal/adminweb/dist && mkdir -p internal/adminweb/dist
|
||||
COPY --from=web /web/dist/ internal/adminweb/dist/
|
||||
RUN CGO_ENABLED=0 go build -o /out/admin ./cmd/admin
|
||||
|
||||
# Stage 3: minimal runtime.
|
||||
FROM scratch
|
||||
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
COPY --from=build /out/admin /admin
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["/admin"]
|
||||
Reference in New Issue
Block a user