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

See my answer in Keycloak does not work with Spring Boot in docker compose - #2 by ThoreKr the environment variables used to configure keycloak are no longer valid.

Additionally, do you have any logs from keycloak or your app?