• 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 ...
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown

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

Ranch Hand
Posts: 462
  • 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: 27494
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.
Do the next thing next. That’s a pretty good rule. Read the tiny ad, that’s a pretty good rule, too.
a bit of art, as a gift, the permaculture playing cards
    Bookmark Topic Watch Topic
  • New Topic