Hacker News new | past | comments | ask | show | jobs | submit login

Did you mean to expose your postgres port to the world?

Adding the port declaration to the docker file exposes it to other containers on the same network/machine, adding it in docker-compose exposes it to the world.




That is explicit. Now that I think about it, I should update the article with how I do it now.

I explicitly bind the external port only to the ZeroTier interface. In fact, my configs have changed a bit:

instead of:

    ports:
        - 5432:5432
I now use the IP of the zerotier interface:

    ports:
        - 192.168.111.123:5432:5432
Now the only way to reach that port is via the vpn.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: