2026-10-14 01:46:48 +03:00
|
|
|
# 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/
|
2026-10-16 01:13:20 +03:00
|
|
|
COPY themes/ /opt/keycloak/themes/
|
2026-10-17 03:01:25 +03:00
|
|
|
# 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
|
2026-10-14 01:46:48 +03:00
|
|
|
ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]
|
|
|
|
|
CMD ["start", "--optimized", "--import-realm"]
|