From e693f720cca71347bcb69786570b0340792e0ed7 Mon Sep 17 00:00:00 2001 From: coward Date: Tue, 4 Jun 2024 16:47:29 +0800 Subject: [PATCH] =?UTF-8?q?:art:=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index d87027c..e20d684 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,19 +22,24 @@ COPY --from=build-stage /front/web/ /build/web ENV GO111MODULE=on ENV GOPROXY=https://goproxy.cn,direct -RUN go build -ldflags="-s -w" -o app && upx -9 app +RUN go build -ldflags="-s -w" -o wgui && upx -9 wgui -RUN ls -lh && chmod +x ./app +RUN ls -lh && chmod +x ./wgui FROM alpine +RUN addgroup -S wgui && \ + adduser -S -D -G wgui wgui + ENV GIN_MODE=release RUN apk --no-cache add ca-certificates wireguard-tools jq iptables WORKDIR /app RUN mkdir -p db -COPY --from=build /build/app /app +COPY --from=build --chown=wgui:wgui /build/wgui /app COPY --from=build /build/template/* /app/template/ +RUN chmod +x wgui + ENTRYPOINT ["./app"] \ No newline at end of file