Skip to content

Instantly share code, notes, and snippets.

@little-pinecone
Last active February 3, 2022 10:00
Show Gist options
  • Save little-pinecone/6b52ccd1fc0296b267e810d43fd01f3b to your computer and use it in GitHub Desktop.
Save little-pinecone/6b52ccd1fc0296b267e810d43fd01f3b to your computer and use it in GitHub Desktop.
Importing Keycloak realms from a directory
KEYCLOAK_VERSION=16.1.1
KEYCLOAK_USER=keycloak
KEYCLOAK_PASSWORD=keycloak
KEYCLOAK_IMPORT_FOLDER=./keycloak/realms/import
version: '3.3'
services:
keycloak:
image: jboss/keycloak:${KEYCLOAK_VERSION}
ports:
- "8024:8080"
environment:
- KEYCLOAK_USER=${KEYCLOAK_USER}
- KEYCLOAK_PASSWORD=${KEYCLOAK_PASSWORD}
volumes:
- ${KEYCLOAK_IMPORT_FOLDER}:/tmp/import
command:
- "-Dkeycloak.migration.action=import"
- "-Dkeycloak.migration.provider=dir"
- "-Dkeycloak.migration.dir=/tmp/import"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment