FROM golang:1.26-alpine AS build
WORKDIR /src
COPY shared/ shared/
COPY notification/go.mod notification/go.sum notification/
WORKDIR /src/notification
RUN go mod download
COPY notification/ .
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /notification .

FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /notification /notification
EXPOSE 8087
USER 65534
ENTRYPOINT ["/notification"]
