🎨更新
All checks were successful
continuous-integration/drone/tag Build is passing

This commit is contained in:
coward 2024-06-04 13:14:18 +08:00
parent be6bf4672b
commit 868bfc9900

View File

@ -4,25 +4,18 @@ WORKDIR front
COPY . . COPY . .
WORKDIR web-src WORKDIR web-src
RUN ls -lh
RUN corepack enable RUN corepack enable
RUN corepack prepare pnpm@8.6.10 --activate RUN corepack prepare pnpm@8.6.10 --activate
RUN npm config set registry https://registry.npmmirror.com RUN npm config set registry https://registry.npmmirror.com
RUN pnpm install RUN pnpm install
RUN pnpm build RUN pnpm build
RUN cd ../web && ls -lh && pwd
FROM golang:alpine as build FROM golang:alpine as build
RUN apk add upx RUN apk add upx
WORKDIR /build WORKDIR /build
COPY . . COPY . .
COPY --from=build-stage /front/web/ /build/web COPY --from=build-stage /front/web/ /build/web
RUN cd ./web && ls -lh
RUN cd ..
# sqlite必须 # sqlite必须
ENV GO111MODULE=on ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct ENV GOPROXY=https://goproxy.cn,direct
@ -33,6 +26,7 @@ RUN ls -lh && chmod +x ./app
FROM alpine FROM alpine
ENV GIN_MODE=release
RUN apk --no-cache add ca-certificates wireguard-tools jq iptables RUN apk --no-cache add ca-certificates wireguard-tools jq iptables
WORKDIR /app WORKDIR /app
@ -41,6 +35,4 @@ RUN mkdir -p db
COPY --from=build /build/app /app COPY --from=build /build/app /app
COPY --from=build /build/template/* /app/template/ COPY --from=build /build/template/* /app/template/
RUN ls -al
ENTRYPOINT ["./app"] ENTRYPOINT ["./app"]