Skip to content

Instantly share code, notes, and snippets.

@maneta
Created November 17, 2017 13:36
Show Gist options
  • Save maneta/1ba7b5a816ab097de9ac962a168af900 to your computer and use it in GitHub Desktop.
Save maneta/1ba7b5a816ab097de9ac962a168af900 to your computer and use it in GitHub Desktop.
entrypoint
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