Hi
it looks very simple to use a custom theme with docker.
All i did was creating a dockerfile
that looks like this:
FROM jboss/keycloak
COPY custom-theme/myTheme /opt/jboss/keycloak/themes/myTheme
The folder custom-theme/myTheme
contains the theme and i can assign it to a realm - perfect.
To deploy it - i create an image of that dockerfile and use it on the server with a docker-compose script (using this keycloak image and postgreSQL)
Now the problem:
From time to time the theme changes.
So i get back to the theme folder, do the changes, create a new docker image with a different version and deploy it to my docker registry.
In my docker-compose file on the server, i just exchange the image version and restart the docker-compose setup. The docker-compose file looks like this:
---
networks:
keycloak:
name: keycloak
services:
keycloak:
depends_on:
- postgres
environment:
DB_ADDR: postgres
DB_DATABASE: <DB_DATABASE>
DB_PASSWORD: <DB_PASSWORD>
DB_SCHEMA: public
DB_USER: <DB_USER>
DB_VENDOR: POSTGRES
KEYCLOAK_PASSWORD: <KEYCLOAK_PASSWORD>
KEYCLOAK_USER: <KEYCLOAK_USER>
PROXY_ADDRESS_FORWARDING: 'true'
JAVA_OPTS_APPEND: "-Dkeycloak.profile.feature.upload_scripts=enabled -Dkeycloak.profile.feature.token_exchange=enabled -Dkeycloak.profile.feature.admin_fine_grained_authz=enabled"
image: "myregistry.com/keycloak:v2.1"
networks:
- keycloak
postgres:
environment:
POSTGRES_DB: <DB_DATABASE>
POSTGRES_PASSWORD: <DB_PASSWORD>
POSTGRES_USER: <DB_USER>
image: postgres
networks:
- keycloak
volumes:
- "postgres_data:/var/lib/postgresql/data"
version: "2"
volumes:
postgres_data:
driver: local
result is: all data from my postgreSQL instance is gone!
When i just restart the docker-container setup (without using a new image version) all data is still there…
What do i wrong?