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.

21 lines
307 B

FROM golang:1.20-alpine as builder
WORKDIR /src/api
COPY . .
RUN go env -w GOPROXY=https://goproxy.cn,direct \
&& go env -w CGO_ENABLED=0 \
&& go mod tidy \
&& go build -o main .
FROM alpine:latest
WORKDIR /src/api
COPY --from=0 /src/api/main ./
EXPOSE 8880
EXPOSE 8890
ENTRYPOINT ./main