Update Dockerfile

master
chaiyd 2020-11-27 17:28:40 +08:00 committed by qiang.ou
parent c59f8b730a
commit 7a949a22bf
1 changed files with 12 additions and 8 deletions

View File

@ -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 ./