infra-iac/files/keycloak/Containerfile

27 lines
1 KiB
Text
Raw Permalink Normal View History

2024-10-16 21:33:03 +02:00
FROM quay.io/keycloak/keycloak:latest as builder
# Enable health and metrics support
ENV KC_HEALTH_ENABLED=true
ENV KC_METRICS_ENABLED=true
# Configure a database vendor
ENV KC_DB=postgres
WORKDIR /opt/keycloak
# for demonstration purposes only, please make sure to use proper certificates in production instead
COPY --chmod=444 sso.mforcen.dev.fullchain.pem /opt/keycloak
COPY --chmod=444 sso.mforcen.dev.key /opt/keycloak
COPY --chmod=444 mforcen.crt /opt/keycloak/conf/truststores
RUN /opt/keycloak/bin/kc.sh build
FROM quay.io/keycloak/keycloak:latest
COPY --from=builder /opt/keycloak/ /opt/keycloak/
# change these values to point to a running postgres instance
ENV KC_DB=postgres
ENV KC_DB_URL=jdbc:postgres://infra-db/keycloak
ENV KC_DB_USERNAME=keycloak
ENV KC_DB_PASSWORD=keycloak_pass
ENV KC_HOSTNAME=sso.mforcen.dev
ENTRYPOINT ["/opt/keycloak/bin/kc.sh", "start", "--optimized", "--https-certificate-file=/opt/keycloak/sso.mforcen.dev.fullchain.pem", "--https-certificate-key-file=/opt/keycloak/sso.mforcen.dev.key"]