# Keycloak with the mancala extension and realm baked in. # Build context: apps/keycloak FROM maven:3.9.11-eclipse-temurin-21 AS extension WORKDIR /build COPY extension/pom.xml . COPY extension/src src RUN mvn -B -q package -Dmaven.test.skip=true # Keep the Keycloak version in sync with keycloak.version in extension/pom.xml FROM quay.io/keycloak/keycloak:26.7.5 AS builder ENV KC_DB=postgres ENV KC_HEALTH_ENABLED=true COPY --from=extension /build/target/mancala-keycloak-extension.jar /opt/keycloak/providers/ RUN /opt/keycloak/bin/kc.sh build FROM quay.io/keycloak/keycloak:26.7.5 COPY --from=builder /opt/keycloak/ /opt/keycloak/ # Imported on startup only if the realm does not exist yet. COPY realm/mancala-realm.json /opt/keycloak/data/import/ COPY themes/ /opt/keycloak/themes/ # Browsers keep theme resources an hour instead of 30 days: their path only changes with Keycloak's version, so a # theme change would otherwise reach returning players a month late. ENV KC_SPI_THEME__STATIC_MAX_AGE=3600 ENTRYPOINT ["/opt/keycloak/bin/kc.sh"] CMD ["start", "--optimized", "--import-realm"]