FROM registry.bstein.dev/streaming/pegasus:1.2.32 AS base

FROM alpine:3.20
RUN apk add --no-cache ca-certificates \
    && addgroup -S pegasus \
    && adduser -S -D -H -u 65532 -G pegasus pegasus
COPY --from=base /pegasus /pegasus
COPY dockerfiles/vault-entrypoint.sh /entrypoint.sh
RUN chmod 0755 /entrypoint.sh

USER pegasus
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/pegasus"]
