FROM golang:alpine as build RUN apk add upx WORKDIR /build COPY . . ENV GO111MODULE=on ENV GOPROXY=https://goproxy.cn,direct RUN go mod download && go build -o app && upx -9 app RUN ls -lh && chmod +x ./app FROM alpine WORKDIR /app WORKDIR db COPY --from=build /build/app /app COPY --from=build /build/template/* /app/template/ RUN ls -al /app/ | grep 'app' ENTRYPOINT ["/app/app"]