akretion / docky

Docky - Helper for docker-compose mainly used in odoo context
GNU Affero General Public License v3.0
56 stars 31 forks source link

document connection to host Postgres #140

Open rvalyi opened 3 years ago

rvalyi commented 3 years ago

WORK IN PROGRESS I got a great boost using the host Postgres along with openupgrade and in general I think it's great to document how to do that.

I used advices from here https://gist.github.com/MauricioMoraes/87d76577babd4e084cba70f63c04b07d

rvalyi commented 3 years ago

key points:

hparfr commented 3 years ago

@rvalyi Why not just mount the socket ?

rvalyi commented 3 years ago

@rvalyi Why not just mount the socket ?

you are right. In fact I tried a lot and was failing because unlike what you would believe you also need to set listen="*" in te postgresql.conf file even when using md5 over the socket when you mount it in your Docker container. So yes it's simpler with the socket. Eventually I'll document it.

rvalyi commented 3 years ago

note for the future for using the host postgres with a socket connection:

Yeah!

hparfr commented 3 years ago

set postgresql.conf with listen_addresses = '*' despite using a unix socket this is required

It's not what the doc says:

if the list is empty, the server does not listen on any IP interface at all, in which case only Unix-domain sockets can be used to connect to it. (source: https://postgresqlco.nf/doc/en/param/listen_addresses/ )

in pg_hba.conf, set a local a md5 auth method for the odoo user with a line like

For sockets, peer can be used instead of md5.