Skip to content

Scalingo buildpack to install Keycloak with PostgreSQL database

License

Notifications You must be signed in to change notification settings

pseudonyme21/keycloak-buildpack

 
 

Repository files navigation

Scalingo Keycloak buildpack

This buildpack aims at installing a Keycloak instance on Scalingo and let you configure it at your convenance.

Deploy to Scalingo

Suitability of releases

Keycloak Buildpack
< 17 (wildfly) 0.1.0
>= 17 (quarkus) 0.2.0

Usage

Add this buildpack environment variable to your Scalingo application to install the Keycloak server:

BUILDPACK_URL=https://github.com/pseudonyme21/keycloak-buildpack

Default version Keycloak is latest found in github releases, but you can choose another one:

scalingo env-set KEYCLOAK_VERSION=17.0.0

See Keycloak latest docs to use keycloak quarkus image server.

Configuration

You must have an add-on database postgresql.

Environment variables are listed in Keycloak quarkus configuration doc, starting with KC_

Add a user admin

In .env set these vars:

KEYCLOAK_ADMIN=your-admin-name
KEYCLOAK_ADMIN_PASSWORD=your-admin-password

then build again.

Export or import data

See Keycloak Admin CLI docs

With Scalingo CLI you can download or upload these files.

Hacking

Environment variables are set in a .env file. You copy the sample one:

cp .env.sample .env

Run an interactive docker scalingo stack:

 docker run --name keycloak -it -p 8080:8080 -v "$(pwd)"/.env:/env/.env -v "$(pwd)":/buildpack scalingo/scalingo-20:latest bash

And test in it:

bash buildpack/bin/detect
bash buildpack/bin/env.sh /env/.env /env
bash buildpack/bin/compile /build /cache /env
bash buildpack/bin/release

Run Keycloak server:

export PATH=$PATH:/build/java/bin
build/keycloak/bin/kc.sh start --auto-build

You can also use docker-compose stack 2:

docker-compose up --build -d

About

Scalingo buildpack to install Keycloak with PostgreSQL database

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Shell 96.4%
  • Dockerfile 3.6%