I am trying to setup a keycloak server from docker compose file(not docker file) and connecting a database on my localhost. So I used host.docker.internal as my DB_ADDR param
version: '3.8'
services:
keycloak:
container_name: keycloak
image: jboss/keycloak:15.0.2
command:
[
'-b',
'0.0.0.0',
'-Dkeycloak.migration.action=import',
'-Dkeycloak.migration.provider=dir',
'-Dkeycloak.migration.dir=/opt/jboss/keycloak/realm-config',
'-Dkeycloak.migration.strategy=OVERWRITE_EXISTING',
'-Djboss.socket.binding.port-offset=1000',
'-Dkeycloak.profile.feature.upload_scripts=enabled',
]
volumes:
- ./realm-config:/opt/jboss/keycloak/realm-config
environment:
- KEYCLOAK_USER=admin
- KEYCLOAK_PASSWORD=xxxxxxx
- DB_VENDOR=mysql
- DB_USER=xxxxxxx
- DB_PASSWORD=xxxxxxxxxx
- DB_DATABASE=xxxxxx
- DB_ADDR=host.docker.internal
and now I get error says:
com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '̫ƽ���ʱ��' is unrecognized or represents more than one time zone. Y
ou must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specific time zone value if you want to utilize time zone support.
It looks like a mysql timezone issue to me, but I have no idea where to put server timezone config in keycloak server in docker compose file