[IMP] Odoo 12.0-13.0: add support for docker secret

In order to avoid postgresql password in an environment variable, a
PASSWORD_FILE environment may be used instead.

This allow the usage of secrets in docker-compose [0]

[0](https://github.com/compose-spec/compose-spec/blob/master/spec.md#secrets)
This commit is contained in:
Christophe Monniez 2021-08-09 15:51:56 +02:00
parent 27f9e7e8ed
commit 233277f7be
3 changed files with 12 additions and 0 deletions

View File

@ -2,6 +2,10 @@
set -e set -e
if [ -v PASSWORD_FILE ]; then
PASSWORD="$(< $PASSWORD_FILE)"
fi
# set the postgres database host, port, user and password according to the environment # set the postgres database host, port, user and password according to the environment
# and pass them as arguments to the odoo process if not present in the config file # and pass them as arguments to the odoo process if not present in the config file
: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}} : ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}}

View File

@ -2,6 +2,10 @@
set -e set -e
if [ -v PASSWORD_FILE ]; then
PASSWORD="$(< $PASSWORD_FILE)"
fi
# set the postgres database host, port, user and password according to the environment # set the postgres database host, port, user and password according to the environment
# and pass them as arguments to the odoo process if not present in the config file # and pass them as arguments to the odoo process if not present in the config file
: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}} : ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}}

View File

@ -2,6 +2,10 @@
set -e set -e
if [ -v PASSWORD_FILE ]; then
PASSWORD="$(< $PASSWORD_FILE)"
fi
# set the postgres database host, port, user and password according to the environment # set the postgres database host, port, user and password according to the environment
# and pass them as arguments to the odoo process if not present in the config file # and pass them as arguments to the odoo process if not present in the config file
: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}} : ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}}