Thanks to everyone who tried to support me here.
The issue was a very minor issue and an oversight. I didn’t add both containers on the same network on my docker-compose file.
After doing that, I was able to speak to MySQL DB with the service name like this:
jdbc:mysql://mysql-service:3306/db_name?.......
mysql-service is the container name
I also didn’t need to expose the port on the host machine or bind IP since the containers could speak with each other.