Keycloak does not work with Spring Boot in docker compose

Surprisingly similar to My keycloak integration with spring worked perfectly when keycloak is in docker-compose and project running locally ! but got error 401 when both worked on dokcer compose are you using some kind of shared source which contains the same incorrect information?

Your compose file can’t work, does keycloak even start? The environment variables still to refer to the wildfly distribution, which is deprecated since version 18. You have to use the new environment variables to configure the database connection.

Next, keycloak doesn’t use the auth subpath any more.

Lastly, if you have separate containers, one container can’t reach the other one via localhost, try using keycloak:8080 to connect to keycloak.

However, you might encounter connection issues if your browser gets involved.