Giter VIP home page Giter VIP logo

keycloak-buildpack's Introduction

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
>= 23 (quarkus) 1.0.0

Usage

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

BUILDPACK_URL=https://github.com/MTES-MCT/keycloak-buildpack

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

scalingo env-set KEYCLOAK_VERSION=23.0.4

See Keycloak latest docs to use keycloak quarkus image server.

!!! HTTPS is mandatory in production mode 4

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 2:

docker run --name keycloak -it -p 8443:8443 -v "$(pwd)"/.env:/env/.env -v "$(pwd)":/buildpack scalingo/scalingo-22: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
build/java/bin/keytool -genkeypair -storepass password -storetype PKCS12 -keyalg RSA -keysize 2048 -dname "CN=server" -alias server -ext "SAN:c=DNS:localhost,IP:127.0.0.1" -keystore /build/keycloak/conf/server.keystore
bash buildpack/bin/release

Run Keycloak server:

export PATH=$PATH:/build/java/bin
export KEYCLOAK_ADMIN=
export KEYCLOAK_ADMIN_PASSWORD=
export KC_DB=postgres
export KC_HOSTNAME=localhost
export KC_HOSTNAME_PORT=8443
build/keycloak/bin/kc.sh --verbose start

You can also use docker-compose stack 3:

docker-compose up --build -d

keycloak-buildpack's People

Contributors

fabiengo avatar hubm avatar olivierroquigny avatar tristanrobert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

keycloak-buildpack's Issues

france-connect moving error

Hi,

I've got an error like that when i use this buildpack to deploy keycloak.

Do you have an idea about that ?

mv: cannot move '/build/b035ec16-fdf5-43c6-8e50-9eea683b818f/tmp/keycloak-franceconnect-4.1.0.jar' to '/build/b035ec16-fdf5-43c6-8e50-9eea683b818f/keycloak/standalone/deployments/keycloak-franceconnect.jar': No such file or directory
-----> Add plugin france connect 4.1.0...  !     An error occurred during buildpack compilation

Scalingo timeout when deploying

First of all, thank you for this buildpack. It is exactly what i was looking for.

I'm new to buildpacks, i followed the described steps but scalingo timeout : Timeout: keycloak-instance took more than 60 seconds to boot.
In the logs, i see this before timeouting: Admin console listening on http://127.0.0.1:9990
I tried to set a specific Port in Env file and Scalingo Env, but keycloak is still exposed in 9990.
Any idea how can i fix this ?

Also, i don't get how i can play the import/export script.

Thanks again

[KEYCLOAK_CLUSTER_MODE] Keycloak in cluster mode in scalingo

Hi, thanks for the buildpack 👍 , we deployed Keycloak successfully in Scalingo with standalone mode.

However, we have a question about Keycloak clustering mode with shared infinispan cache.

It's not working because the Scalingo deployment constraint. Did you find a way to run it with cluster mode in scalingo ?

Thanks for your feedback

[UPDATE] right now, it's not possible to deploy Keycloak with cluster mode in Scalingo.
The reason is that the containers cannot recognize each others using the discovery protocols of JGroups

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.