1

as of now we are migrating our spring boot monolith to self containing micro services and have installed and configured keycloak including its login ui in a separate service on port 8999. Other spring boot services (including their ui) run on port 8080, 8082 etc.

In order to speed up development we want to create a local Docker setup that is able to function as an integratable complete setup of our service architecture. So that I can start any service on localhost and all other services can be stated w from a Docker compose file.

The problem here seems to be keycloak. As the clients identify to keycloak as localhost but are setup as distinct containers with different ips that publish their ports to the host which is the developer laptops windows os.

When I try to login from the host, all redirects to keycloak work fine but the redirect from keycloak back to the registered client fails.

Do I need some kind of setup where the hostnames of all containers are the same within Docker and in the Docker host? Editing windows host file seems out of the question, though. How would you solve this?

javanoob
  • 243
  • 1
  • 10
  • This seems to be answered here. I will try to use Docker compose aliases and report back: https://stackoverflow.com/questions/57213611/keycloak-and-spring-boot-web-app-in-dockerized-environment – javanoob May 23 '21 at 09:00

1 Answers1

0

On Windows you should definitely avoid WSL. It complicates network setups cause it uses another network device layer on top. Without WSL I was able to simply connect to all services via their compose aliases and also had no problems with keycloak anymore.

javanoob
  • 243
  • 1
  • 10