• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

I cannot figure out why my docker databases will not connect with the microservices- Spring Boot

 
Ranch Hand
Posts: 468
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to get my docker SQL databases connected to my microservices, but I keep getting exceptions that the connection failed.  I cannot figure out why.  

I have the docker-compose.yml here.




This is my application.properties file for the inventory service.  





The service for the SQL launches and is in a container working, but my inventory service in Spring Boot will not connect to it.
 
Saloon Keeper
Posts: 28480
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't give a simple answer here, but a few notes might help.

I've never seen "expose" as a run parameter for Docker, only in Dockerfiles. I'm not sure what that's all about, but it might be blocking access when you thought you were granting it.

Docker has several networking. The simplest is to merely let the containers share the same network as the host. A popular alternative is to let Docker set up a VPN between containers, however, and that's quite common when you have service containers with their own private database.
 
Can't .... do .... plaid .... So I did this tiny ad instead:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic