# Optional container image, for those who prefer Docker to the systemd service.
FROM golang:1.27 AS build
WORKDIR /src
COPY . .
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /sipt-relay .

FROM gcr.io/distroless/static:nonroot
COPY --from=build /sipt-relay /sipt-relay
EXPOSE 8443
# Mount the certificate in /certs; map host port 443 to 8443
ENTRYPOINT ["/sipt-relay", "-listen", ":8443", "-cert", "/certs/fullchain.pem", "-key", "/certs/privkey.pem"]
