🎨添加静态打包
Some checks failed
continuous-integration/drone/tag Build is failing

This commit is contained in:
coward
2024-08-21 09:10:01 +08:00
parent 941b8da804
commit 12e551b4e9
135 changed files with 15749 additions and 3 deletions

View File

@@ -1,9 +1,23 @@
# 打包前端
FROM node:18-alpine as build-front
WORKDIR front
COPY . .
WORKDIR web
RUN corepack enable
RUN corepack prepare pnpm@8.6.10 --activate
RUN npm config set registry https://registry.npmmirror.com
RUN pnpm install
RUN pnpm build
# 前后端集成打包
FROM golang:alpine as build
FROM golang:alpine as build-backend
RUN apk add upx
WORKDIR /build
COPY . .
COPY --from=build-front /front/dist/ /build/dist
# sqlite必须
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct
@@ -23,8 +37,8 @@ RUN apk --no-cache add ca-certificates wireguard-tools jq iptables
WORKDIR /app
RUN mkdir -p db
COPY --from=build --chown=wgui:wgui /build/wgui /app
COPY --from=build /build/template/* /app/template/
COPY --from=build-backend --chown=wgui:wgui /build/wgui /app
COPY --from=build-backend /build/template/* /app/template/
RUN chmod +x wgui