-
Notifications
You must be signed in to change notification settings - Fork 120
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
Using unique service db names #515
base: main
Are you sure you want to change the base?
Conversation
629560c
to
0ee4957
Compare
@ap-wtioit How does this look to you? |
This to me seems not just a problem with db service but with all services (e.g. smtp). I'm not sure if it is wise to run multiple Odoo projects/instances in the same network. (Or are you talking about the inverseproxy_shared network only?) What i get from the changes:
When using this please make sure the value of _key is a valid hostname otherwise some key values might cause connection issues. E.g. We are using a modified prod.yaml with and additional .docker/db-host.env file where PGHOST is defined and on deployment the file is created by symlinking to something like To prevent multiple services:
odoo:
...
networks:
default: {}
globalwhitelist_shared: {}
inverseproxy_shared:
aliases:
- "${DB_NAME:-odoo}-${DOODBA_ENVIRONMENT:-prod}"
... We use this for nginx providing access to Odoo from the web (instead of using traeffik). So to sum it up, it looks ok. Only if someone already added PGHOST in db-access.env (or in our case new db-host.env) this could be a breaking change if Edit: expected to need longer to find this. But indeed |
Hi Andreas, First of all, thank you for your detailed feedback and suggestions! 😊 To clarify, yes, this issue occurs specifically with the inverseproxy_shared network. It's a very odd problem because it only happens on a couple of servers, while on the rest everything works just fine. Also, regarding your setup, we actually use one PostgreSQL container per Odoo instance, rather than having one container per PostgreSQL version. This approach helps us avoid conflicts between instances, but the shared network issue seems to still persist in those specific cases (I think it cloud be a kind of bug on Docker Compose). Our PGHOST is currently defined here. However, I need it to change dynamically based on the unique db service name, which is the reason behind my changes. |
ca133d6
to
a39a3e3
Compare
d6765c0
to
c5362b7
Compare
d4e7d5f
to
dbb5614
Compare
dbb5614
to
5e432a2
Compare
ff8f96c
to
ff7d505
Compare
Use a unique Compose project name in tests to avoid volume collisions when running multiple PostgreSQL versions in parallel.
ff7d505
to
6fe3c9f
Compare
CC @Tecnativa TT54598
When multiple Odoo projects are deployed within the same Docker network, there is a risk that an instance of Odoo may inadvertently connect to the database of another project due to identical service names. This PR addresses the issue by ensuring unique service names, preventing unintended cross-project database connections and ensuring proper project isolation.