wireguard-dashboard/Dockerfile
coward 866cd7747c 🎨
2024-05-09 11:49:26 +08:00

28 lines
456 B
Docker

FROM golang:alpine as build
RUN apk add upx
WORKDIR /build
COPY . .
# sqlite必须
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct
RUN go build -ldflags="-s -w" -o app && upx -9 app
RUN ls -lh && chmod +x ./app
FROM alpine
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 /build/template/* /app/template/
RUN ls -al
ENTRYPOINT ["./app"]