21 lines
404 B
Docker
21 lines
404 B
Docker
FROM docker.xd.xkm.be/golang:1.26.1-trixie AS builder
|
|
|
|
WORKDIR /build
|
|
|
|
COPY go.mod go.sum .
|
|
|
|
RUN GOPROXY='https://goproxy.cn,direct' go mod download
|
|
|
|
COPY cmd ./cmd
|
|
COPY internal ./internal
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
|
|
go build -trimpath -ldflags="-s -w" -o /app ./cmd/api
|
|
|
|
FROM scratch
|
|
WORKDIR /
|
|
|
|
COPY --from=builder /app /app
|
|
COPY db/migration /db/migration
|
|
|
|
ENTRYPOINT ["/app"] |