Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor pg connection #14

Open
wants to merge 7 commits into
base: v2
Choose a base branch
from
Open

Refactor pg connection #14

wants to merge 7 commits into from

Conversation

sebastienbeau
Copy link
Member

@sebastienbeau sebastienbeau commented Feb 11, 2025

@sebastienbeau sebastienbeau force-pushed the v2-pg-var-refactor branch 4 times, most recently from 1204320 to 5ebab96 Compare February 12, 2025 10:23
- only pass PG variable (the entrypoint will do the mapping for odoo)
- remove deprecated file secrets.docker-compose
- remove PG info from secret as it's not a property of the project
It's not recommanded to use '-' in database, and using -- everywhere feel weird so just use it for domain
- always use secret as it's a best practice
- unencrypt the secret once a the start of the process
- Port all improvement done in previous version
- allow to run test in parallele of update (using different .env file)
@sebastienbeau sebastienbeau force-pushed the v2-pg-var-refactor branch 3 times, most recently from 8375daf to 5f74366 Compare February 12, 2025 13:36
@@ -136,6 +136,7 @@ fetch:
- git fetch --all
- git checkout ${NEW_HEAD}
- sops -d ci.secrets.docker-compose.yml > secrets.docker-compose.yml
- ./bin/generate_env
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generate_env => generate_ci_env

@rvalyi
Copy link
Member

rvalyi commented Feb 13, 2025

@sebastienbeau for the record for the projects we have, we use to mount the host Postgres socket and do a Unix socket connection. Indeed, in small projects/onsite we use Postgres on the same host and when I tried it was a hassle to guess the host Postgres IP from a container and it could even change after restarts or Docker upgrades.

The Unix socket works pretty well, but if Postgres is restarted on the host (like after a security upgrade for instance), then the socket is changed somewhat and the Odoo container should be restarted.

I'm not sure if it would be great to use a public DNS for the Postgres host in our case (and hence avoid the changing host IP), but may be...

Not sure how it might relate with the changes you are doing but just reporting we tend to use it this way...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants