This is docker-compose
setup for Keycloak server configured with postgres database, with nginx https termination and lightweight mail server.
- keycloak-postgres, 2.4.0.Final
- postgres, 9.5
- nginx configuration for https termination, borrowed from anvilreserach and customized for Keycloak
- mailcatcher
- Clone this repository and run
docker-compose up
- In separate shell, run
./add-cert-to-java-truststore.sh
. Fix script for your local java setup, idea is to put custom (self-signed) certificate into javacacerts
- Add to your
/etc/hosts
file record foridentity.keycloak.tom
referencing127.0.0.1
127.0.0.1 identity.keycloak.tom
- point your browser to https://identity.keycloak.tom
- accept insecure site, or add ./keycloak-nginx/certs/identity.keycloak.tom.cert to browser's truststore
- default admin account added to Keycloak is:
- Username: admin
- Password: password
- in
standalone.xml
, I've modified 2 lines:- line 410:
<http-listener name="default" socket-binding="http" redirect-socket="https" proxy-address-forwarding="true"/>
- This modification tells Keycloak to pull the client’s IP address from the X-Forwarded-For header since it's behind nginx.
- line 412:
<host name="default-host" alias="localhost" default-web-module="keycloak-server.war">
- This modification deploys Keycloak as default application on root path (context)
- line 410:
cat /etc/os-release
:NAME=Fedora VERSION="23 (Twenty Three)" ID=fedora VERSION_ID=23 PRETTY_NAME="Fedora 23 (Twenty Three)" ANSI_COLOR="0;34" CPE_NAME="cpe:/o:fedoraproject:fedora:23" HOME_URL="https://fedoraproject.org/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Fedora" REDHAT_BUGZILLA_PRODUCT_VERSION=23 REDHAT_SUPPORT_PRODUCT="Fedora" REDHAT_SUPPORT_PRODUCT_VERSION=23 PRIVACY_POLICY_URL=https://fedoraproject.org/wiki/Legal:PrivacyPolicy
uname -a
: Linux xxx.XXX 4.8.10-100.fc23.x86_64 #1 SMP Mon Nov 21 20:37:11 UTC 2016 x86_64 x86_64 x86_64 GNU/Linuxdocker --version
: Docker version 1.12.3, build 6b644ecdocker-compose --version
: docker-compose version 1.8.1, build 878cff1