19 lines
413 B
Docker
19 lines
413 B
Docker
FROM --platform=$BUILDPLATFORM golang:1.26-alpine AS builder
|
|
|
|
RUN apk add --no-cache git
|
|
WORKDIR /app
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
ARG TARGETOS
|
|
ARG TARGETARCH
|
|
|
|
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH \
|
|
go build -ldflags "-s -w" -o shap-planner-backend .
|
|
|
|
FROM scratch
|
|
COPY --from=builder /app/shap-planner-backend /shap-planner-backend
|
|
ENTRYPOINT ["/shap-planner-backend"] |