-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from projectsyn/doc/theme
Add how-to on custom themes
- Loading branch information
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
= Configure custom theme | ||
|
||
Keycloak provides theme support for web pages and emails. | ||
This allows customizing the look and feel of end-user facing pages so they can be integrated with your applications. | ||
|
||
The intended approach to configure a custom theme is to bundle the theme in a container image and copy it to the correct location as an init container. | ||
|
||
== Creating custom theme | ||
|
||
A theme can provide one or more types to customize different aspects of Keycloak. | ||
A theme consists of: HTML templates, images, message bundles, stylesheets, scripts and theme properties. | ||
|
||
|
||
Follow xref:how-tos/keycloak-tls.adoc[the official guide] on how to create a custom theme | ||
|
||
Once you have created your custom theme, you'll need to package it into a container image. | ||
|
||
[source,dockerfile] | ||
---- | ||
FROM docker.io/library/busybox | ||
COPY theme /theme | ||
RUN \ | ||
chmod -R +r /theme | ||
USER 1001:0 | ||
---- | ||
|
||
|
||
|
||
== Deploying custom theme | ||
|
||
With the theme accessible in a container image we can deploy it using an init container. | ||
In combination with an emptyDir volume that's shared with the Keycloak container, we copy the theme over to the right place where Keycloak will pick it up automatically. | ||
|
||
[source,yaml] | ||
---- | ||
parameters: | ||
keycloak: | ||
extraInitContainers: | ||
theme-provider: | ||
image: company/keycloak-theme:v1.0.0 | ||
imagePullPolicy: IfNotPresent | ||
command: | ||
- sh | ||
args: | ||
- -c | ||
- | | ||
echo "Copying theme..." | ||
cp -R /theme/* /company-theme | ||
volumeMounts: | ||
- name: theme | ||
mountPath: /company-theme | ||
extraVolumes: | ||
theme: | ||
emptyDir: {} | ||
extraVolumeMounts: | ||
theme: | ||
readOnly: true | ||
mountPath: /opt/jboss/keycloak/themes/company | ||
---- | ||
|
||
[TIP] | ||
==== | ||
See xref:how-tos/keycloak-tls.adoc[the official deploy guide] for a more detailed look into deploying themes. | ||
==== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters