| 3 | # docker build -f apps/delivery/Dockerfile . |
| 4 |
| 5 | FROM golang:1.25 AS build |
| 6 | WORKDIR /src |
| 7 | # Dependencies first, so a code change doesn't re-download them. |
| 8 | COPY apps/delivery/go.mod apps/delivery/go.sum ./ |
| 9 | RUN go mod download |
| 10 | COPY apps/delivery/ ./ |
| 11 | RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /delivery . |
| 12 |
| 13 | # No shell or libc, only CA certificates: the binary is statically linked. |
| 14 | FROM gcr.io/distroless/static-debian12:nonroot |
| 15 | COPY --from=build /delivery /delivery |
| 16 | EXPOSE 8080 |
| 17 | ENTRYPOINT ["/delivery"] |