This question has been flagged
1 Reply
8063 Views

Hi,

I need to understand which would be the recommendation for database configuration using docker-compose environment variables and the odoo.conf configuration file.

Case 1:

I am having some issues when trying to use ‘POSTGRES_DB=postgres’ in the docker-compose db service and then when web service load, it asked for a new database name, I would like to know why? after that I put postgres and it raises the next error:

“Database creation error: database ‘postgres’ already exists!”

Case 2:

If I decide to use a different name in the docker-compose db service “’POSTGRES_DB=development” and then if I configure the odoo.conf with db_name=development the bootstrap of odoo (8069) application never found the database and fail.

Please let me know which would be good practice to implement it.

13:07

The docker-compose file look like this:

version: '2'

services:

web:

image: odoo:13.0

depends_on:

- db

ports:

- "8069:8069"

volumes:

- odoo-web-data:/var/lib/odoo

- ./config:/etc/odoo

- ./addons:/mnt/extra-addons

env_file: ./config/.env

db:

image: postgres:10

volumes:

- odoo-db-data:/var/lib/postgresql/data/pgdata

env_file:

- ./config/.env

volumes:

odoo-web-data:

odoo-db-data:

-----------------------------

the env file:

USER=user_odoo

PASSWORD=development

POSTGRES_PASSWORD=development

POSTGRES_USER=user_odoo

POSTGRES_DB=postgres

PGDATA=/var/lib/postgresql/data/pgdata

-----------------------------


Odoo v 13.0

Avatar
Discard
Best Answer

Dont' use POSTGRES_DB=postgres that's PG system database

Create a new user (e.g.: odoo) with create database role and set the database name something like v13_odoo 

Avatar
Discard