FROM golang:1.18 AS builder ENV CGO_ENABLED 0 ENV GOOS linux COPY . /src WORKDIR /src RUN export GIT_TERMINAL_PROMPT=1 RUN git config --global url."git.gz.internal.jumaiyx.cn:222".insteadof "https://git.gz.internal.jumaiyx.cn/" RUN go env -w GOPROXY="https://goproxy.cn" RUN go env -w GOINSECURE="git.gz.internal.jumaiyx.cn" RUN go env -w GOPRIVATE="git.gz.internal.jumaiyx.cn/" RUN go env -w GONOSUMDB="git.gz.internal.jumaiyx.cn/" RUN go env -w GONOPROXY="git.gz.internal.jumaiyx.cn/" RUN go env RUN go mod tidy RUN make build FROM alpine RUN apk update --no-cache && apk add --no-cache ca-certificates tzdata ENV TZ Asia/Shanghai WORKDIR /app COPY --from=builder /src/bin/server /app/server COPY --from=builder /src/configs /app/configs #EXPOSE 9000 #ENTRYPOINT ["./server"]