Skip to content

Commit 233277f

Browse files
committed
[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)
1 parent 27f9e7e commit 233277f

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

12.0/entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
set -e
44

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

13.0/entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
set -e
44

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

14.0/entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
set -e
44

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

0 commit comments

Comments
 (0)