first
This commit is contained in:
15
Dockerfile
Normal file
15
Dockerfile
Normal 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"]
|
||||
Reference in New Issue
Block a user