Created
November 17, 2017 13:36
-
-
Save maneta/1ba7b5a816ab097de9ac962a168af900 to your computer and use it in GitHub Desktop.
entrypoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ "$DB_VENDOR" == "POSTGRES" ]; then | |
databaseToInstall="postgres" | |
elif [ "$DB_VENDOR" == "MYSQL" ]; then | |
databaseToInstall="mysql" | |
elif [ "$DB_VENDOR" == "H2" ]; then | |
databaseToInstall="" | |
else | |
if (printenv | grep '^POSTGRES_' &>/dev/null); then | |
databaseToInstall="postgres" | |
elif (printenv | grep '^MYSQL_' &>/dev/null); then | |
databaseToInstall="mysql" | |
fi | |
fi | |
if [ "$databaseToInstall" != "" ]; then | |
echo "[KEYCLOAK DOCKER IMAGE] Using the external $databaseToInstall database" | |
/bin/sh /opt/jboss/keycloak/bin/change-database.sh $databaseToInstall | |
else | |
echo "[KEYCLOAK DOCKER IMAGE] Using the embedded H2 database" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment