Docker support ui

This commit is contained in:
CareyWong 2020-03-30 16:02:17 +08:00
parent c1ecf275d4
commit 13eb812c51

View File

@ -1,6 +1,6 @@
FROM golang:1.13-alpine AS dependencies FROM golang:1.13-alpine AS dependencies
WORKDIR /app WORKDIR /app
RUN go env -w GO111MODULE="on" RUN go env -w GO111MODULE="on" && go env -w GOPROXY="https://goproxy.cn,direct"
COPY go.sum go.mod ./ COPY go.sum go.mod ./
RUN go mod tidy RUN go mod tidy
@ -13,5 +13,6 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o myurls main.go
FROM scratch FROM scratch
WORKDIR /app WORKDIR /app
COPY --from=build /app/myurls ./ COPY --from=build /app/myurls ./
COPY public/* ./public/
EXPOSE 8002 EXPOSE 8002
ENTRYPOINT ["/app/myurls"] ENTRYPOINT ["/app/myurls"]