This commit is contained in:
2025-03-05 22:29:14 +08:00
commit 53b259b72e
5 changed files with 280 additions and 0 deletions

15
Dockerfile Normal file
View File

@@ -0,0 +1,15 @@
FROM golang:1.23-alpine as builder
ARG CGO_ENABLED=0
WORKDIR /app
COPY go.mod go.sum ./
RUN go env -w GO111MODULE=on
RUN go env -w GOPROXY=https://goproxy.cn,direct
RUN go mod download
COPY main.go ./
RUN go build -o api
FROM scratch
COPY --from=builder /app/api /api
ENTRYPOINT ["/api"]