Files
codeapi/Dockerfile
2025-09-28 13:08:58 +08:00

15 lines
290 B
Docker

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"]