Skip to content

zileo-net/clevercloud-keycloak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CleverCloud Keycloak template

This project allows you to deploy a Keycloak server on CleverCloud without using any container.

Deployment instructions

  1. Fork this project
  2. Create a Java + JAR application based on a fork of this repository
  3. Link the application to a PostgreSQL or MySQL add-on. If not, it will use a local DB
  4. Copy the following environment variable in expert mode :
KEYCLOAK_VERSION="18.0.0"
KEYCLOAK_ADMIN=admin
KEYCLOAK_ADMIN_PASSWORD=password
KC_FEATURES=token-exchange
KC_METRICS_ENABLED=true
KC_HTTP_PORT=8080
KC_DB_POOL_INITIAL_SIZE=1
KC_DB_POOL_MIN_SIZE=1
KC_DB_POOL_MAX_SIZE=5
CC_JAR_PATH=./keycloak/lib/quarkus-run.jar
CC_JAVA_VERSION="11"
CC_METRICS_PROMETHEUS_PORT=8080
CC_PRE_BUILD_HOOK="./build.sh"
CC_RUN_COMMAND="./start.sh"

You can check for the last Keycloak version here.

First of all, adapt the KC_DB_POOL_INITIAL_SIZE, KC_DB_POOL_MIN_SIZE, KC_DB_POOL_MAX_SIZE variables according to the database plan you choose. By default, it's been configured for the DEV plan (limited to 5 connections).

Define your initial admin account with KEYCLOAK_ADMINand KEYCLOAK_ADMIN_PASSWORD

On the first run, Keycloak will build a runable JAR with the optional features, the database driver, and the metrics subsystem.

Although the application will boot this way, it will be usable with the default *.cleverapps.io. Define KC_HOSTNAMEvariable with your own domain name. If this var is not define, Keycloak will disallow "STRICT_HOSTNAME" feature.

FYI

The Java + JAR is used to get a dedicated Java runtime, but we do not use any Keycloak JAR to start the server. We use the dedicated Keycloak shell script for starting the server. But as that Runtime first check for the definition and the existence of a JAR file, so we use the CC_JAR_PATHto the quarkus jar.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Languages