jeffutter / dokku-postgresql-plugin

Plugin to setup postgresql accounts for containers deployed with Dokku
GNU General Public License v2.0
35 stars 13 forks source link

Postgres port exposed outside of Docker #15

Open bjornpost opened 9 years ago

bjornpost commented 9 years ago

I just discovered that this container binds itself to 0.0.0.0:5432 instead of 127.0.0.1:5432. I'm not sure this is intended behavior; I guess only other containers should be able to connect to the database, not the entire world. The fix is easy, in commands, line 95, change docker run -p 5432:5432 ... to docker run -p 127.0.0.1:5432:5432 ....

bjornpost commented 9 years ago

Thoughts, @jeffutter ?

warrenguy commented 9 years ago

If you're using Debian/Ubuntu, you can add:

DOCKER_OPTS="--ip 127.0.0.1"

to your /etc/defaults/docker, which will make this the default behaviour.