I tried to create a Docker container for my Odoo application. I wanted to have a customized password so I used this docker compose sample from Hub Docker for Odoo but changing the version to Odoo 18 and Postgres 17
services:
web:
image: odoo:18.0
depends_on:
- db
ports:
- "8069:8069"
volumes:
- odoo-web-data:/var/lib/odoo
- ./config:/etc/odoo
- ./addons:/mnt/extra-addons
environment:
- PASSWORD_FILE=/run/secrets/postgresql_password
secrets:
- postgresql_password
db:
image: postgres:17
environment:
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD_FILE=/run/secrets/postgresql_password
- POSTGRES_USER=odoo
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- odoo-db-data:/var/lib/postgresql/data/pgdata
secrets:
- postgresql_password
volumes:
odoo-web-data:
odoo-db-data:
secrets:
postgresql_password:
file: odoo_pg_pass
I also have a odoo.conf:
[options]
addons_path = /mnt/extra-addons
data_dir = /var/lib/odoo
Few months ago, I did this with my laptop (but still using Postgres 16) and it worked. I am trying to do this with my desktop computer (using Postgres 17) but it did not worked, having an issue in the Odoo Database creation screen with a "Database creation error: Access Denied", as I put in the Master Password the password found in odoo_pg_pass. I tried to use the exact configuration as in my laptop (using Postgres 16) but still it did not worked, though it is actually still working in my laptop. My laptop and desktop are both Windows and have an updated Docker Desktop.
The difference I noticed between the laptop and desktop during the Odoo creation screen is that in the laptop, the Master Password is generated randomly and shown.
But in my desktop, it is not shown, and it did not recognized the password in the odoo_pg_pass. Also in the laptop, after successful db creation, there will be an admin_password line in odoo.conf
So I guess, I need the master password to be initially generated? How could I do that? Again there was no difference in the code but in my desktop it did not show.