Here my DockerFile :-
FROM openjdk:10
ENV AQUILA_HOME /data/config
#USER root
#VOLUME /tmp
ADD a2i-web-1.0.0-SNAPSHOT.jar app.jar
#RUN bash -c 'touch /app.jar'
ENTRYPOINT ["java","-jar","app.jar"]
My jar is spring boot application which requires postgres. I installed portgres locally and it is successfully runnning on my localhost. I am building DockerFile successfully by command
sudo docker build -t djtijare/a2i-web:v1 .
But while running it by command
sudo docker run -p 8080:8080 -t djtijare/a2i-web:v1
giving exception as :
Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
I am running this docker command from directory containing DockerFile and my jar Do I need to set any configuration to run postgres?