generated from pkg/go-template
20 lines
526 B
Docker
20 lines
526 B
Docker
|
FROM golang:1.17 as builder
|
||
|
ENV GO111MODULE on
|
||
|
ENV GOPROXY https://goproxy.io,direct
|
||
|
WORKDIR /go/cache
|
||
|
ADD go.mod .
|
||
|
ADD go.sum .
|
||
|
RUN go mod download -x
|
||
|
WORKDIR /go/src
|
||
|
ADD . .
|
||
|
RUN go mod tidy
|
||
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o service_lark ./app/zeus/service/lark
|
||
|
|
||
|
FROM reg.icechen.cn/alpine as lark
|
||
|
WORKDIR /go/src
|
||
|
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
|
||
|
COPY --from=builder /go/src/service_lark ./
|
||
|
ENV TZ=Asia/Shanghai
|
||
|
RUN chmod +x ./service_lark
|
||
|
EXPOSE 8080
|
||
|
CMD ["./service_lark"]
|