I’m very new to docker. I’ve been searching for my answer but all i found did not worked.
I have installed docker on my local server (Synology) and ran two linked containers - one for nodejs, the other for postgresql.
I can access in my terminal, with my local IP or my public IP to the postgresql container and create a new db and so on… by accessing my server in ssh, run an instance in my docker container and log with psql.
Now, i would like to access my database with an app like PGadmin or Tableplus on my laptop but it doesn’t work. I’have published the container on my 5431 port and set a POSTGRES_PASSWORD in my environment but I always get this message when i try to connect :
“server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.”
To be honest i don’t know which IP adress i should use so tried with all IP i know. When i type docker ps it returns :
0.0.0.0:5431->5431/tcp
When I type docker inspect my-postgres-container, it returns :
EDIT : Thank you for your answer @sdetweil. I followed the instructions of this topic. I entered in the conf file but it was already written that all IP (v4) were listned (i had to install nano also) :
listen_adress = ‘*’
I also uncomment the default port and change it for 5431. Now it’s fully working, i use this adress :
my.server.adress : 5431
I’ve also been able to access my postgres container by creating a new container with the pgadmin’s image on the same machine and in the same docker network.
Just edited my message :D. I made a mistake in my local adress in Tableplus, now it’s working.
And it also working outside of my network, that’s perfect. I can use Table Plus and connect to my database from everywhere with my laptop.