You should be able to specify the POSTGRES_DATABASE
env variable for the data source:
docker ... -e POSTGRES_DATABASE=<your_database_name> ...
By default, it should be using the database name 'keycloak'
, so it's weird you don't see that:
/subsystem=datasources/data-source=KeycloakDS: add(jndi-name=java:jboss/datasources/KeycloakDS,enabled=true,use-java-context=true,use-ccm=true, connection-url=jdbc:postgresql://${env.POSTGRES_ADDR:postgres}:${env.POSTGRES_PORT:5432}/${env.POSTGRES_DATABASE:keycloak}, driver-name=postgresql)
source code:
https://github.com/jboss-dockerfiles/keycloak/blob/cd866b905d026eb69dab5176b352064252d92aff/server/cli/databases/postgres/change-database.cli#L2
Update
Sorry, I see what you mean. In that case, I think you'll have to manually create the schema in the database, then update the standalone.xml
to use your schema:
<spi name="connectionsJpa">
<provider name="default" enabled="true">
<properties>
<property name="dataSource" value="java:jboss/datasources/KeycloakDS"/>
<property name="initializeEmpty" value="true"/>
<property name="migrationStrategy" value="update"/>
<property name="migrationExport" value="${jboss.home.dir}/keycloak-database-update.sql"/>
<property name="schema" value="your_schema"/>
</properties>
</provider>
</spi>
It looks like they don't support automatic schema creation, so you'll probably have to submit a feature request.