ab612f290f
When nothing is passed as argument to the docker container, the entrypoint will receive the content of the CMD of the dockerfile. In this case we have to pass the database configuration arguments, else Odoo won't run correctly. This is the case when you run the command of our documentation: ``` docker run -p 8069:8069 --name odoo --link db:db -t odoo ``` However, it should still be possible to run custom command (like `ls /`).
26 lines
576 B
Bash
Executable File
26 lines
576 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
# set the postgres database host, port, user and password
|
|
: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}}
|
|
: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}}
|
|
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
|
|
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}
|
|
# pass them as arguments to the odoo process
|
|
DB_ARGS=("--db_user" $USER "--db_password" $PASSWORD "--db_host" $HOST "--db_port" $PORT)
|
|
|
|
case "$1" in
|
|
-- | odoo)
|
|
shift
|
|
exec odoo "${DB_ARGS[@]}" "$@"
|
|
;;
|
|
-*)
|
|
exec odoo "${DB_ARGS[@]}" "$@"
|
|
;;
|
|
*)
|
|
exec "$@"
|
|
esac
|
|
|
|
exit 1
|