You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
784 B
29 lines
784 B
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"] |