Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
cc0318e
Current from https://github.com/jboss-dockerfiles/keycloak/tree/maste…
solsson Oct 30, 2016
81bc036
Adds the startup args from https://github.com/jboss-dockerfiles/keycl…
solsson Oct 30, 2016
8090388
Pegs to a specific keycloak release
solsson Oct 30, 2016
9d31063
Swaps keycloak's db to mysql (mariadb 10.1 for its bundled Galera sup…
solsson Oct 30, 2016
946e522
Uses the equivalent keycloak-mysql as base
solsson Oct 31, 2016
a837f5d
Sets mysql default charset
solsson Nov 7, 2016
75c9919
Giving up on haproxy because of https://github.com/dockerfile/haproxy…
solsson Nov 7, 2016
d7790a5
Disables UTF8 charset because it causes MYSQL error: Specified key wa…
solsson Nov 7, 2016
5eb4075
This project is about apache so use httpd for load balancing too
solsson Nov 7, 2016
68a0af8
Adds a second keycloak instance
solsson Nov 7, 2016
172f8ac
Reverts to a single instance to verify that it works with the load ba…
solsson Nov 7, 2016
d0891fb
Works behind balancer with keycloak-ha.xml too
solsson Nov 7, 2016
3df647b
standalone.xml copied from keycloak-mysql:2.3.0.Final, for reference
solsson Nov 7, 2016
8b644f1
standalone-ha.xml copied from keycloak-mysql:2.3.0.Final
solsson Nov 7, 2016
41e8ee5
Adds the second keycloak instance. Produces invalid redirects.
solsson Nov 7, 2016
1cc1712
Removes the http://mod-cluster.jboss.org/ subsystem, as we want our o…
solsson Nov 7, 2016
ee5f1c3
Removes UDP to try to enforce TCP (non multicast)
solsson Nov 7, 2016
1816ff8
Removes mping due to its mentioning of multicast
solsson Nov 7, 2016
4461003
Don't expose the management port, reached using ./bin/jboss-cli.sh
solsson Nov 7, 2016
1211f2e
Adds jgroups TCP ports, tough I have no clue what -fd is used for.
solsson Nov 7, 2016
b4660b1
Tries to configure according to http://jgroups.org/manual4/index.html…
solsson Nov 7, 2016
af17f43
Switches from udp to tcp for jgroups, I think
solsson Nov 7, 2016
deee906
Revert "Tries to configure according to http://jgroups.org/manual4/in…
solsson Nov 7, 2016
5a94720
Sadly initial_hosts only support IP addresses. With hostnames it fail…
solsson Nov 7, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ See [docker-compose.yml](https://github.com/Reposoft/openidc-keycloak-test/blob/
Might be run like this:
```
compose="docker-compose -f build-contracts/docker-compose.yml"
$compose up --build -d postgres keycloak openidc
$compose up --build -d mysql keycloak openidc
$compose up --build keycloak-setup #TODO
$compose up --build -d testclient
$compose logs -f
Expand Down
66 changes: 49 additions & 17 deletions build-contracts/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
version: '2'
services:
postgres:
image: postgres:9.6
mysql:
image: mariadb:10.1
expose:
- "5432"
- "3306"
environment:
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: keycloak
MYSQL_ROOT_PASSWORD: openidctest
MYSQL_DATABASE: keycloak
MYSQL_USER: keycloak
MYSQL_PASSWORD: keycloak
# Causes: Change Set META-INF/jpa-changelog-1.0.0.Final.xml::1.0.0.Final::[email protected] failed. Error: Specified key was too long; max key length is 767 bytes [Failed SQL: ALTER TABLE keycloak.REALM_SOCIAL_CONFIG ADD PRIMARY KEY (REALM_ID, NAME)]: liquibase.exception.DatabaseException: Specified key was too long; max key length is 767 bytes [Failed SQL: ALTER TABLE keycloak.REALM_SOCIAL_CONFIG ADD PRIMARY KEY (REALM_ID, NAME)]
#command:
# - --character-set-server=utf8mb4
# - --collation-server=utf8mb4_unicode_ci
keycloak:
image: jboss/keycloak-postgres:2.3.0.Final
build:
context: ../keycloak-ha-mysql
image: solsson/keycloak-ha-mysql
links:
- postgres
- mysql
environment:
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: openidctest
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: keycloak
MYSQL_DATABASE: keycloak
MYSQL_USER: keycloak
MYSQL_PASSWORD: keycloak
# Workaround for container using legacy Docker links, resulting in
# "WFLYCTL0211: Cannot resolve expression 'jdbc:postgresql://${env.POSTGRES_PORT_5432_TCP_ADDR}...")n
POSTGRES_PORT_5432_TCP_ADDR: postgres
# "WFLYCTL0211: Cannot resolve expression 'jdbc:mysql://${env.MYSQL_PORT_3306_TCP_ADDR}:${env.MYSQL_PORT_3306_TCP_PORT}
MYSQL_PORT_3306_TCP_ADDR: mysql
MYSQL_PORT_3306_TCP_PORT: "3306"
expose:
- "8080"
- "9090"
# For local browser; you also need "keycloak" in your hosts file
ports:
- "8080:8080"
- "9990:9990"
- "7600"
- "57600"
# Uncomment the following and docker-compose up keycloak again to export realms
volumes:
- ./keycloak-setup/export:/export
Expand All @@ -34,6 +41,31 @@ services:
# - -Dkeycloak.migration.action=export
# - -Dkeycloak.migration.provider=dir
# - -Dkeycloak.migration.dir=/export
keycloak2:
build:
context: ../keycloak-ha-mysql
image: solsson/keycloak-ha-mysql
links:
- mysql
environment:
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: openidctest
MYSQL_DATABASE: keycloak
MYSQL_USER: keycloak
MYSQL_PASSWORD: keycloak
MYSQL_PORT_3306_TCP_ADDR: mysql
MYSQL_PORT_3306_TCP_PORT: "3306"
expose:
- "8080"
- "7600"
- "57600"
keycloak-ha:
build: ./ha
links:
- keycloak
# For local browser; you also need "keycloak" in your hosts file
ports:
- "8080:80"
httpd-openidc:
build: ../httpd-openidc
image: localhost:5000/reposoft/httpd-openidc
Expand All @@ -44,7 +76,7 @@ services:
build: ./openidc
depends_on:
- httpd-openidc
- keycloak
- keycloak-ha
# Don't allow direct communication with keycloak; depends on hosting scenario
#links:
# - keycloak
Expand Down
11 changes: 11 additions & 0 deletions build-contracts/ha/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM httpd:2.4

RUN sed -i 's|#LoadModule proxy_module|LoadModule proxy_module|' conf/httpd.conf \
&& sed -i 's|#LoadModule proxy_http_module|LoadModule proxy_http_module|' conf/httpd.conf \
&& sed -i 's|#LoadModule proxy_balancer_module|LoadModule proxy_balancer_module|' conf/httpd.conf \
&& sed -i 's|#LoadModule slotmem_shm_module|LoadModule slotmem_shm_module|' conf/httpd.conf \
&& sed -i 's|#LoadModule lbmethod_byrequests_module|LoadModule lbmethod_byrequests_module|' conf/httpd.conf

RUN echo "Include conf/proxy.conf" >> conf/httpd.conf

COPY proxy.conf conf/
18 changes: 18 additions & 0 deletions build-contracts/ha/proxy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

#LogLevel debug

# Getting rid of:
# [proxy_http:debug] [pid 8:tid 139765064062720] mod_proxy_http.c(1894): [client 172.27.0.1:41148] AH01113: HTTP: declining URL balancer://keycloakinform/
# [proxy:warn] [pid 8:tid 139765064062720] [client 172.27.0.1:41148] AH01144: No protocol handler was valid for the URL /inform. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
# 172.27.0.1 - - [07/Nov/2016:10:08:17 +0000] "POST /inform HTTP/1.1" 500 528
#<Location /inform>
# Require all denied
#</Location>

<Proxy "balancer://keycloak">
BalancerMember "http://keycloak:8080"
BalancerMember "http://keycloak2:8080"
ProxySet lbmethod=byrequests
</Proxy>
ProxyPass "/" "balancer://keycloak/"
#ProxyPassReverse "/" "balancer://keycloak/"
7 changes: 7 additions & 0 deletions keycloak-ha-mysql/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM jboss/keycloak-mysql:2.3.0.Final

CMD ["-b", "0.0.0.0", "--server-config", "standalone-ha.xml"]

RUN rm keycloak/standalone/configuration/standalone.xml

ADD standalone-ha.xml keycloak/standalone/configuration/standalone-ha.xml
Loading