wireguard-dashboard/Dockerfile
coward e8ecc231b5
Some checks failed
continuous-integration/drone/tag Build is failing
🎨
2024-05-08 16:44:46 +08:00

27 lines
459 B
Docker

FROM golang:alpine as build
RUN apk add upx && apk add build-base
WORKDIR /build
COPY . .
# sqlite必须
ENV CGO_ENABLED=0
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct
RUN CGO_ENABLED=1 go build -ldflags="-s -w" -installsuffix cgo -o app && up -9 app
RUN ls -lh && chmod +x ./app
FROM alpine
WORKDIR /app
RUN mkdir -p db
COPY --from=build /build/app /app
COPY --from=build /build/template/* /app/template/
RUN ls -al
ENTRYPOINT ["./app"]