FROM quay.io/oauth2-proxy/oauth2-proxy:v7.6.0 AS base

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

USER oauth2-proxy
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/bin/oauth2-proxy"]
