Follow up on my previous blog about running Keycloak in Docker with an external DB, in this document, I’d like to show you how you can achieve with docker compose easily
Note: source codes can be found at https://github.com/ozbillwang/keycloak-compose
Step One
Update your local hosts file. For example, on Linux, add the following line to /etc/hosts:
127.0.0.1 keycloak.com.au
On Windows, the file path is usually: c:\Windows\System32\Drivers\etc\hosts
Step Two
Prepare Dockerfile for Keycloak. Please refer to the previous blog post on Run Keycloak in docker with extenal DB for guidance.
Step Three
Prepare the docker-compose file (e.g., docker-compose.yml). Make sure you place the Dockerfile and docker-compose.yml in the same folder.