0

Im trying to use docker-compose to run 2 containers of 2 existing images ( SQL image with a database built in already & spring app container containing a jar file ) , but somehow i couldn't manage to make them communicate .these are the screenshots :

error-screenshot1 error-screenshot2 error-screenshot3 error-screenshot4 app.properties-prod docker-compose dockerfile-DB dockerfile-app pomXML pomXml pomXml

i tried upgrading and downgrading the jdk image but i think the problem is not in the jdk , the application runs fine in a seperated container , so i know the problem is with the jdbc version or something , i upgraded the version of the jdbc in the pom.xml i built the jar file again , and same thing again , the projects is using a lot of plugins , lombok , flyway .... i thought maybe some of those tools is blocking the communication ..

  • 1
    Is it because app tries to talk to mysql even before it is completely up? Can you try adding a healthcheck to mysql and set the depends_on condition accordingly? May be https://stackoverflow.com/questions/42567475/docker-compose-check-if-mysql-connection-is-ready can help. – clement Feb 24 '23 at 15:49
  • Please don't use screenshots of text in your questions. Paste in the text and use the formatting tools to format your post. That makes it a lot easier for people to copy/paste your files if they want to try to reproduce your issue. – Hans Kilian Feb 24 '23 at 16:39

0 Answers0