ARG KC_VERSION=25.0 # Discord provider build FROM --platform=$BUILDPLATFORM maven:3-openjdk-17 AS discord_builder RUN git clone https://github.com/andythorne/keycloak-discord --branch fix-keycloak-25 --depth 1 /keycloak-discord WORKDIR /keycloak-discord RUN mvn package # Keycloak build FROM --platform=$BUILDPLATFORM quay.io/keycloak/keycloak:${KC_VERSION} AS builder ENV KC_HEALTH_ENABLED=true ENV KC_METRICS_ENABLED=true ENV KC_DB=postgres ENV KC_FEATURES=docker,hostname:v2 ENV KC_FEATURES_DISABLED=kerberos,ciba,fips ENV KC_CACHE=local ENV KC_HTTP_ENABLED=true ENV KC_PROXY_HEADERS=xforwarded COPY --from=discord_builder \ /keycloak-discord/target/keycloak-discord-0.5.1-SNAPSHOT.jar \ /opt/keycloak/providers/discord.jar WORKDIR /opt/keycloak RUN /opt/keycloak/bin/kc.sh build FROM quay.io/keycloak/keycloak:${KC_VERSION} COPY --from=builder /opt/keycloak/ /opt/keycloak/ ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]