I'm practicing with docker, I can create a working image and container, but so far I've only tried with apps without database, now I'm trying with one with a mysql database, when I start the container, however, I get connection refused as an error.. .how do I pass db credentials to docker?
these are the commands I entered in the terminal to create the container:
-mvn clean package;
-docker build -t app:0.0.1-SNAPSHOT .;
-docker run -d --name=app-p 8761:8761 app:0.0.1-SNAPSHOT
This is my dockerfile:
FROM openjdk:19-slim
EXPOSE 8761
ADD target/app-0.0.1-SNAPSHOT.jar app-0.0.1-SNAPSHOT.jar
ENTRYPOINT ["java","-jar","/app-0.0.1-SNAPSHOT.jar"]
I'm trying to connect to my localhost db