My rails application is running in docker. I am having my server running and listening on host 'localhost' and port 3000. But when I hit the browser with 'http://localhost:3000/' I get the below error-
PG::ConnectionBad at /
could not connect to server: Connection timed out Is the server running on host "db" (184.168.221.24) and accepting TCP/IP connections on port 5432?
I am unable to find out from where this '184.168.221.24' IP is coming. Thanks.
dbcontainer. Containers run on a virtual network on your machinedbcontainer is either not starting up properly or not allowing connnections from your app container. Can you verify that yourdbcontainer is running (docker ps). And did youexposeport 5432 on yourdbcontainer?