not able to connect to second container from first container in cent os

Hi,
We have 2 different containers in cent os, one is having keycloak server and other container is having spring boot application bundled with angular frontend.

somehow spring boot is not able to connect to keycloak, and it is throwing no route to host exception. we are giving container name while connecting to keycloak . but in logs it is showing VM ip address for connection.

container name is automatically getting converted to host VM ip address , which in turns giving no route to host exception.

Let me know if you need any additional information.

Server: Docker Engine - Community
Engine:
Version: 20.10.10

Share your Docker commands or docker-compose.yml.

Containers are not VMs, do you also use virtualization?

Hi,
Below is the docker-compose.yml

version: ‘3’

services:
-keycloak:
image: nexus.intern:40100/test/fusion-iams-keycloak-docker-image:13.0.0
environment:
KC_DB: mssql
# use latest IPv4 address to connect MSSQL DB
KC_DB_URL: jdbc:sqlserver://10.111.4.21:1434;encrypt=true;trustServerCertificate=true;databaseName=fiamsdb
KC_DB_USERNAME: sa
KC_DB_PASSWORD: Password!2345#
KC_HOSTNAME: 10.111.2.195
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
KC_TRANSACTION_XA_ENABLED: “false”
KC_HOSTNAME_STRICT_BACKCHANNEL: “true”
ports:
- 8080:8080
volumes:
- “/opt/logs/keycloak:/opt/gd/app/keycloak-installer/log:rw”
slta-app:
image: nexus.intern:40100/gd/slta-docker-image:1.1.1-SNAPSHOT
volumes:
- “/opt/logs/slta:/opt/gd/app/logs:rw”
- “/opt/config.json:/opt/config/config.json”
ports:
- 8450:8450
environment:
spring.datasource.password: Password!2345#

Please format your post by wrapping the content in a preformated text block using three backticks ``` in the line before and after the content.