I'm running on the same host a tomcat container where I've deployed a web application and an oracle DB container. The settings I'm using the following settings to connect from the web app to the oracle DB container:
spring.datasource.url: jdbc:oracle:thin:@<IP of the host>:1521:xe
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.driverClassName=com.mysql.jdbc.Driver
As I'm exposing the port 1521 to the host, I was expecting to be able to connect to the Oracle DB with no issues, furthermore, I can connect from my laptop to the Oracle DB using DbVisualizer using the settings described above. I've also got into the tomcat container and pinged the host with success.
I know I could link both containers when running the "docker run" command but I was wondering if it could work this way too.
Any ideas? Thanks!