Hi, thanks for you great article. It was in fact the only one that worked for me. that is until then I was not able to have my springboot app talk to my mysql database both running in docker. see my docker-compose.yml:
What I found out is that the way the datasource URL is defined, is very impactive to how the connection is reacting.
What I had was missing is that when I add the ports into my datasource url (e.g.: jdbc:mysql://mysql-service:3308/logaas?...)
I get a connection refused but whithout them in the URL it works fine. However Now I am unable to connect with MSQL workbench (that is not in docker container) to connect to the running database. Strange because my database port is published to 3308:3306.
So except for not understanding why the ports cannot be in the URL I am stuck with connecting my client to the database container.
do you have any suggestion?
Blogpost:
I have a question about Containerizing your Spring boot application with Docker.
Description:
Hi, thanks for you great article. It was in fact the only one that worked for me. that is until then I was not able to have my springboot app talk to my mysql database both running in docker. see my docker-compose.yml:
What I found out is that the way the datasource URL is defined, is very impactive to how the connection is reacting. What I had was missing is that when I add the ports into my datasource url (e.g.: jdbc:mysql://mysql-service:3308/logaas?...) I get a connection refused but whithout them in the URL it works fine. However Now I am unable to connect with MSQL workbench (that is not in docker container) to connect to the running database. Strange because my database port is published to 3308:3306.
So except for not understanding why the ports cannot be in the URL I am stuck with connecting my client to the database container. do you have any suggestion?
Thanks Yvan