-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keycloak #138
Keycloak #138
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
version: '3.5' | ||
|
||
services: | ||
####################### Database ####################### | ||
database: | ||
|
@@ -34,7 +32,7 @@ services: | |
env_file: | ||
- keycloak/.env | ||
volumes: | ||
- ./keycloak/config/realm-export.json:/tmp/realm-export.json | ||
- ./keycloak/config:/opt/keycloak/data/import | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New location for the configuration files |
||
ports: | ||
- ${KEYCLOAK_HTTP_PORT:-30001}:8080 | ||
- ${KEYCLOAK_HTTPS_PORT:-30002}:443 | ||
|
@@ -45,7 +43,7 @@ services: | |
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
healthcheck: | ||
test: curl -s -f http://localhost:8080/auth/realms/hsb || exit 1 | ||
test: curl -s -f http://localhost:8080/realms/hsb || exit 1 | ||
interval: 5m | ||
timeout: 15s | ||
retries: 3 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# https://hub.docker.com/r/jboss/keycloak/ | ||
FROM jboss/keycloak:16.1.1 | ||
FROM keycloak/keycloak:24.0.1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New image because the old one doesn't exist anymore |
||
|
||
EXPOSE 8080 | ||
|
||
COPY ./config/*.json /tmp/ | ||
|
||
ENTRYPOINT ["/opt/keycloak/bin/kc.sh", "start-dev", "--import-realm"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,8 @@ docker exec -it {ContainerID} bash | |
|
||
```bash | ||
$ docker exec -it hsb-keycloak bash | ||
|
||
# Old jboss image | ||
$ /opt/jboss/keycloak/bin/standalone.sh \ | ||
-Dkeycloak.migration.action=export \ | ||
-Dkeycloak.migration.provider=singleFile \ | ||
|
@@ -45,6 +47,10 @@ $ /opt/jboss/keycloak/bin/standalone.sh \ | |
-Djboss.http.port=8888 \ | ||
-Djboss.https.port=9999 \ | ||
-Djboss.management.http.port=7777 | ||
|
||
# New Keycloak image | ||
/opt/keycloak/bin/kc.sh \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New export and import commands |
||
export --file /opt/keycloak/data/import/realm-export.json --realm hsb | ||
``` | ||
|
||
## Import Realm | ||
|
@@ -54,18 +60,25 @@ To import a previously exported realm configuration execute the following comman | |
|
||
```bash | ||
$ docker exec -it hsb-keycloak bash | ||
|
||
# Old jboss image | ||
$ /opt/jboss/keycloak/bin/standalone.sh \ | ||
-Djboss.socket.binding.port-offset=100 \ | ||
-Dkeycloak.migration.action=import \ | ||
-Dkeycloak.profile.feature.scripts=enabled \ | ||
-Dkeycloak.profile.feature.upload_scripts=enabled \ | ||
-Dkeycloak.migration.provider=singleFile \ | ||
-Dkeycloak.migration.file=/tmp/realm-export.json | ||
|
||
# New Keycloak image | ||
/opt/keycloak/bin/kc.sh \ | ||
import --file /opt/keycloak/data/import/realm-export.json | ||
``` | ||
|
||
or | ||
|
||
```bash | ||
# Old jboss image | ||
$ docker run -e KEYCLOAK_USER=<USERNAME> -e KEYCLOAK_PASSWORD=<PASSWORD> \ | ||
-e KEYCLOAK_IMPORT=/tmp/example-realm.json -v /tmp/example-realm.json:/tmp/example-realm.json jboss/keycloak | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new keycloak doesn't use the
auth
path