forked from ouqiang/gocron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (24 loc) · 762 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM golang:1.15-alpine as builder
RUN apk update \
&& apk add --no-cache git ca-certificates make bash yarn nodejs
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
FROM alpine:3.12
RUN apk add --no-cache ca-certificates tzdata \
&& addgroup -S app \
&& adduser -S -g app app
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
WORKDIR /app
COPY --from=builder /app/gocron/bin/gocron .
RUN chown -R app:app ./
EXPOSE 5920
USER app
ENTRYPOINT ["/app/gocron", "web"]