Worker-app unable to connect to postgres db

Hello guys, I am following along the Docker for beginners course. Now i am trying the deploy simple voting APP (GitHub - mmumshad/kubernetes-example-voting-app: Deploy Docker's example voting app on Kubernetes). Now i am having some trouble starting the worker-app. The worker-app requires redis (redis) and postgres (db) databases. Both of them are running. Every time when running the worker-app i am getting the message " waiting for db". As you can see both redis and postgres are running. How can i get more logs to understand why worker-app not able to connect to db ?

here is screenshot where you can see that the postgres running

for your information when i run postgres db i had specify the password as option as it won’t let me without a password being specified. Maybe it is the issue ?

i believe i need to set the parameter POSTGRES_HOST_AUTH_METHOD: “trust” when running docker run. can’t see how to do it yet



Hi @tajoel2005

Apparently, you get a response on docker slack group, i let the link to the discussion here :

Regards

You need to use:

sudo docker run -d -e POSTGRES_HOST_AUTH_METHOD=trust --name=db postgres:9.4

or

docker run -d -e POSTGRES_HOST_AUTH_METHOD=trust --name=db postgres:9.4

1 Like