This guide describes how to setup a IAM instance locally using docker container and import existing realm.json file.
- Keycloak official image: jboss/keycloak
docker run --name keycloak -p 8088:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -d jboss/keycloak
Import the realm.json located in current directory
After importing the realm, the users need to be created manually.
Example users:
-
User 1: company 1 user
Password: changeme
Role: OEM, Dismantler -
User 2: company 2 user
Password: changeme
Role: Recycler
Install the keycloak plugin for vuejs app from npm install keycloak-js
The keycloak configurations are defined in dpp-frontend/src/services/service.const.js.
npm install --legacy-peer-deps
npm run serve
docker build -t <IMAGE_NAME>:<IMAGE_TAG> .
docker run -p <HOST_PORT>:<CONTAINER_PORT> --name <CONTAINER_NAME> -d <IMAGE_NAME>:<IMAGE_TAG>
docker tag <IMAGE_NAME>:<IMAGE_TAG> <REGISTRY>/<IMAGE_NAME>:<IMAGE_TAG>
docker push <REGISTRY>/<IMAGE_NAME>:<IMAGE_TAG>
docker stop <CONTAINER_NAME>;
docker rm <CONTAINER_NAME>;
Add this parameter when running docker run:
-e "JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000" -p 8000:8000