Publishing Postgres ports #268
-
I'd need to connect to remote Postgres via local GUI tool. I guess I need to publish postgres ports for that. Is there a complete instruction or an example of that? I found this: https://github.com/Tecnativa/docker-postgres-autoconf#certs, but it lucks information about how to generate those files, what is the proper way to specify CERT variable on using doodba-scaffolding, etc. Once I figure it out, I can send such instruction to the README |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It's a little bit tricky. Yes, we have used that in the past and as it's tightly tied to our deployment system, which handles secrets, it's not straightforward to do. However, all you need to do is make sure you supply that JSON/volumes info to that postgres image. It will automatically enable SSL security and auth. Then just expose the ports in the After that, you can connect remotely to that postgres using the same user and password odoo uses. Or you can even create an entrypoint.d script that ensures persistence of a readonly user, if you need it for BI. The sky is the limit! If you need that for local development, however, encryption is not needed. The smartest solution would be Tecnativa/doodba-scaffolding#10, which became stale because I'm not personally much interested in it (I did it for @sergio-teruel but none of us continued with it really), and I didn't like that it doesn't work out of the box (you still need to specify the user and password, and connection settings... for a local dev env I should be able to feed that to the process and just open the port locally and it should just work). You can supersede that PR if you want |
Beta Was this translation helpful? Give feedback.
-
You can use https://github.com/Tecnativa/docker-postgres-autoconf/blob/master/tests/certgen to help generate those files |
Beta Was this translation helpful? Give feedback.
It's a little bit tricky. Yes, we have used that in the past and as it's tightly tied to our deployment system, which handles secrets, it's not straightforward to do.
However, all you need to do is make sure you supply that JSON/volumes info to that postgres image. It will automatically enable SSL security and auth. Then just expose the ports in the
db
service in yourdocker-compose.yaml
.After that, you can connect remotely to that postgres using the same user and password odoo uses. Or you can even create an entrypoint.d script that ensures persistence of a readonly user, if you need it for BI. The sky is the limit!
If you need that for local development, however, encryption is not need…