PORT environment variable conflicts with Google Cloud Run
Nobody has claimed this yet.
- Dominant language
- Dockerfile
- Stars
- 1.2k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
As documented in the Odoo Docker Readme, the Odoo container expects the following environment variables:
- HOST: The address of the postgres server. If you used a postgres container, set to the name of the container. Defaults to db.
- PORT: The port the postgres server is listening to. Defaults to 5432.
- USER: The postgres role with which Odoo will connect. If you used a postgres container, set to the same value as POSTGRES_USER. Defaults to odoo.
- PASSWORD: The password of the postgres role with which Odoo will connect. If you used a postgres container, set to the same value as POSTGRES_PASSWORD. Defaults to odoo.
Unfortunately, the name for PORT conflicts with the PORT variable used in Google Cloud Run, which is the port of the application server, not the port of the database. This means that Odoo cannot be deployed on Google Cloud Run without additional workarounds.
Suggested backwards-compatible fix: allow DB_HOST and DB_PORT as environment variables, and if they are present, they are used instead of HOST and PORT when connecting to Postgres.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the Odoo Docker image configuration and the environment-variable documentation in the Odoo Docker Readme. Trace how the database host and port are read, then verify that the proposed variable precedence preserves existing deployments while allowing Google Cloud Run's PORT value to target the application server.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, google-cloud, postgresql
- Domain
- cloud, databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100