[FIXED] Entrypoint.sh
- Se agrega archivo entrypoint.sh a plantillas de configuración - Se agrega funcionalidad para copiar plantilla entrypoint.sh a la raíz del proyecto - Otras modificaciones menores
This commit is contained in:
parent
230c6c59ca
commit
c1721b5168
5 changed files with 45 additions and 6 deletions
|
@ -75,7 +75,7 @@ function odoo_configure_form() {
|
|||
c_hlp[1]="${odhlp_001}"
|
||||
c_mod[1]=1
|
||||
c_opt[1]=0
|
||||
c_def[1]="$BIN_HOME/data/$PROJECT_NAME/db"
|
||||
c_def[1]="$BIN_HOME/data/${PROJECT_NAME}/db"
|
||||
c_val[1]=0
|
||||
c_dat[1]=""
|
||||
# Input: Path Odoo Data
|
||||
|
@ -84,7 +84,7 @@ function odoo_configure_form() {
|
|||
c_mod[2]=1
|
||||
c_opt[2]=0
|
||||
c_val[2]=0
|
||||
c_def[2]="$BIN_HOME/data/$PROJECT_NAME/files"
|
||||
c_def[2]="$BIN_HOME/data/${PROJECT_NAME}/files"
|
||||
c_dat[2]=""
|
||||
# Input: Path Odoo Backup
|
||||
c_lbl[3]="${odlbl_003}"
|
||||
|
|
|
@ -25,6 +25,7 @@ DOCKER_BASE=dockerfile.base
|
|||
DOCKER_SAAS=dockerfile.saas
|
||||
DOCKER_BUILD=build
|
||||
DOCKER_FILE=Dockerfile
|
||||
DOCKER_ENTRY=entrypoint.sh
|
||||
|
||||
# Test library
|
||||
function baselib_test() {
|
||||
|
|
|
@ -99,11 +99,31 @@ function copy_dockerfile() {
|
|||
|
||||
local ODOO_PATH=$1
|
||||
local ODOO_PROJ=$2
|
||||
local DOCKERFILE=$3
|
||||
local BUILDTEMPLATE=$3
|
||||
local BUILDFILE=$4
|
||||
|
||||
if [ ! -f "$ODOO_PATH/$ODOO_PROJ/$DOCKER_BUILD/$DOCKER_FILE" ]
|
||||
if [ ! -f "$ODOO_PATH/$ODOO_PROJ/$DOCKER_BUILD/$BUILDFILE" ]
|
||||
then
|
||||
cp $DOCKERFILE "$ODOO_PATH/$ODOO_PROJ/$DOCKER_BUILD/$DOCKER_FILE"
|
||||
cp $BUILDTEMPLATE "$ODOO_PATH/$ODOO_PROJ/$DOCKER_BUILD/$BUILDFILE"
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "[x] $odmsg_009"
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
# Copy docker entrypoint.sh file to root project path
|
||||
function copy_entrypoint() {
|
||||
|
||||
local ODOO_PATH=$1
|
||||
local ODOO_PROJ=$2
|
||||
local ENTRYTEMPLATE=$3
|
||||
local ENTRYPOINT=$4
|
||||
|
||||
if [ ! -f "$ODOO_PATH/$ODOO_PROJ/$ENTRYPOINT" ]
|
||||
then
|
||||
cp $ENTRYTEMPLATE "$ODOO_PATH/$ODOO_PROJ/$ENTRYPOINT"
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "[x] $odmsg_009"
|
||||
|
|
|
@ -122,7 +122,10 @@ fi
|
|||
odoo_structure $BIN_HOME "$PROJECT_NAME"
|
||||
|
||||
# Copy dockerfile template file to build (local)
|
||||
copy_dockerfile $BIN_HOME "$PROJECT_NAME" "$BIN_HOME/$ODOO_CFG/$DOCKER_LOCAL"
|
||||
copy_dockerfile $BIN_HOME "$PROJECT_NAME" "$BIN_HOME/$ODOO_CFG/$DOCKER_LOCAL" "$DOCKER_FILE"
|
||||
|
||||
# Copy entrypoint template file to build (local)
|
||||
copy_dockerfile $BIN_HOME "$PROJECT_NAME" "$BIN_HOME/$ODOO_CFG/$DOCKER_ENTRY" "$DOCKER_ENTRY"
|
||||
|
||||
# Copy odoo config template file to etc (base)
|
||||
copy_odooconfig $BIN_HOME "$PROJECT_NAME" "$BIN_HOME/$ODOO_CFG/$ODOO_CFG_BASE"
|
||||
|
|
15
config/entrypoint.sh
Normal file
15
config/entrypoint.sh
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# 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
|
||||
: ${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:='odoo15@2021'}}}
|
||||
|
||||
# install python packages
|
||||
pip3 install pip --upgrade
|
||||
pip3 install -r /etc/odoo/requirements.txt
|
||||
|
Loading…
Reference in a new issue