I'm trying to run a docker container that contains postgres and access its localhost on my application. However, I am getting this error:
UserRDD$ docker run -i --rm -e PGPASSWORD=12qw --network=host postgres:10.9 psql -h localhost -p 5433 -U postgres -d postgres -f -
psql: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5433?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5433?
The same code seems to be running for someone else. Not sure what I am missing.
Can you please let me know what I am missing. Been trying to struggle with it for the last 3 hours.
Thanks
psqlfrom the host?docker run -i --rm -e PGPASSWORD=12qw --network=host postgres:10.9without the second argument and that started the docker. I'm so confused.