spring.application.name=account
spring.datasource.url=jdbc:mysql://0.0.0.0:3307/eazyaccountsdb
spring.datasource.username=root
spring.datasource.password=root
spring.jpa.show-sql=true
server.port=8181
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
spring.jpa.sql.init.mode=always
the bove shows my properties file i am using dockerfile to create docker container
deanayalon
(Dean Ayalon)
October 4, 2024, 6:21pm
2
Are you using Docker Compose? If so, show your compose file please
Now, I do not wokr with Spring and I may be wrong, but it seems you’re trying to access the other container using mysql://0.0.0.0
, why?
Generally, to access another contianer on the same network, you can use the container or service name
Hi There I just started using docker i am just using a Dockerfile here and I tried to replace the host with MYSQL container name also but it didn’t work. I have been getting this issue:
org.hibernate.exception.JDBCConnectionException: unable to obtain isolated JDBC connection [Communications link failure
0.0.0.0
is used for listening on ports (listen on all available IPs), but not to connect.
Using the service name or container name should be the right approach with Docker, share your Docker compose file(s) or CLI command(s).