feat: template

This commit is contained in:
2022-01-06 00:19:22 +08:00
parent 723372fe4d
commit ca8d741b37
15 changed files with 243 additions and 15 deletions
+20
View File
@@ -0,0 +1,20 @@
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
WORKDIR /go/src
ADD . .
RUN go mod tidy
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o api_lark ./app/api/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/api_lark ./
ENV TZ=Asia/Shanghai
RUN chmod +x ./api_lark
EXPOSE 8080
CMD ["./api_lark"]