Skip to content

Instantly share code, notes, and snippets.

@gabrielmoura
Created March 2, 2024 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabrielmoura/fe87229ace74d83d707008d7f28372bc to your computer and use it in GitHub Desktop.
Save gabrielmoura/fe87229ace74d83d707008d7f28372bc to your computer and use it in GitHub Desktop.
Keycloak Tailwind Theme

Keycloak + Tailwind Theme

FROM registry.access.redhat.com/ubi9 AS ubi-micro-build
RUN mkdir -p /mnt/rootfs
RUN dnf install --installroot /mnt/rootfs curl --releasever 9 --setopt install_weak_deps=false --nodocs -y && \
dnf --installroot /mnt/rootfs clean all && \
rpm --root /mnt/rootfs -e --nodeps setup
#####################################################################
FROM quay.io/keycloak/keycloak:23.0 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
RUN keytool -genkeypair -storepass password -storetype PKCS12 -keyalg RSA -keysize 2048 -dname "CN=server" -alias server -ext "SAN:c=DNS:localhost,IP:127.0.0.1" -keystore conf/server.keystore
# Jar generated from the keywind project
COPY keywind/out/keywind.jar /opt/keycloak/providers/keywind.jar
RUN /opt/keycloak/bin/kc.sh build
#####################################################################
FROM quay.io/keycloak/keycloak:23.0
COPY --from=builder /opt/keycloak/ /opt/keycloak/
COPY --from=ubi-micro-build /mnt/rootfs /
# change these values to point to a running postgres instance
ENV KC_DB=postgres
ENV KC_DB_URL=jdbc:postgresql://postgres:5432/keycloak?user=postgres&password=password&createDatabaseIfNotExist=true&characterEncoding=UTF-8&rewriteBatchedStatements=true
ENV KC_HOSTNAME=localhost
ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment