odoo / docker

Other
931 stars 1.51k forks source link

[IMP] Odoo 15.0-17.0: Make psycopg2.connect dbname configurable. #482

Closed amh-mw closed 6 months ago

amh-mw commented 6 months ago

This allows the system administrator to set the standard PostgreSQL environment variable POSTGRES_DB to change the name of the database created by default.

Fixes #358.

amh-mw commented 6 months ago

This is untested; I don't know what the odoo docker image build environment looks like. 🤦 Running docker build . --tag odoo:15 now.

amh-mw commented 6 months ago

POSTGRESDB per Environment Variables section of https://hub.docker.com//postgres/

amh-mw commented 6 months ago

So I've tested a bit and now think this pull request is dead on arrival. Here's why:

--database doesn't have to be just one value, so it's not guaranteed to be reasonable to be passed to psycopg2.connect(dbname=...)

This is a side effect of the arguments parsed in entrypoint.sh being used for both wait-for-psql.py and the odoo binary.