From 7a949a22bfd5aaec631005759303458e9582f654 Mon Sep 17 00:00:00 2001 From: chaiyd <34934673+chaiyd@users.noreply.github.com> Date: Fri, 27 Nov 2020 17:28:40 +0800 Subject: [PATCH] Update Dockerfile --- Dockerfile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index c7f5aa8..b3c2e22 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,17 @@ -FROM golang:1.10-alpine as builder - -WORKDIR /go/src/github.com/ouqiang/gocron - -COPY . . +FROM golang:1.15-alpine as builder RUN apk update \ - && apk add --no-cache git ca-certificates make bash nodejs yarn + && apk add --no-cache git ca-certificates make bash yarn nodejs -RUN make install-vue \ +RUN go env -w GO111MODULE=on && \ + go env -w GOPROXY=https://goproxy.cn,direct + +WORKDIR /app + +RUN git clone https://github.com/ouqiang/gocron.git \ + && cd gocron \ + && yarn config set ignore-engines true \ + && make install-vue \ && make build-vue \ && make statik \ && CGO_ENABLED=0 make gocron @@ -22,7 +26,7 @@ RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime WORKDIR /app -COPY --from=builder /go/src/github.com/ouqiang/gocron/bin/gocron . +COPY --from=builder /app/gocron/bin/gocron . RUN chown -R app:app ./