# The route proxy, as a module ships one.
#
# Static and FROM scratch like the control plane's image, and for the same reason: it is fetched
# by digest and run on a machine, so everything in it is something a person would have to audit.
FROM golang:1.25-alpine AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -trimpath -ldflags '-s -w' -o /mesh-route-proxy ./examples/route-proxy

FROM scratch
COPY --from=build /mesh-route-proxy /mesh-route-proxy
ENTRYPOINT ["/mesh-route-proxy"]
