DEV Community

Discussion on: Be careful with Docker ports!

Collapse
 
raiandian profile image
Ryan Jan Borja

(If I get it right), If I only want PostgreSQL to be accessible from the host machine I should not include a custom network and my docker run command should look like this.
docker run -d --publish 127.0.0.1:5433:5432. If I want it to be accessible within the network or even outside, I should remove 127.0.0.1.

Thread Thread
 
kovah profile image
Kevin Woblick

Yes, that's correct.