Skip to content

Commit ffd928f

Browse files
[FIX] entrypoint: Do not enforce pip auto installation
Make this optional thoought an environment variable
1 parent 011755d commit ffd928f

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ _testlogs/
77
!/src/**/
88
!/src/**/.gitkeep
99
.gitmodules
10-
10+
*.sh
1111

1212
# Created by https://www.gitignore.io/api/test,macos,linux,python,windows,pycharm,virtualenv,sublimetext,visualstudiocode
1313
# Edit at https://www.gitignore.io/?templates=test,macos,linux,python,windows,pycharm,virtualenv,sublimetext,visualstudiocode

Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ ENV WKHTMLTOPDF_CHECKSUM ${WKHTMLTOPDF_CHECKSUM:-1140b0ab02aa6e17346af2f14ed0de8
1212
ARG NODE_VERSION
1313
ENV NODE_VERSION ${NODE_VERSION:-8}
1414

15+
# PIP auto-install requirements.txt (change value to "1" to auto-install)
16+
ENV PIP_AUTO_INSTALL=${PIP_AUTO_INSTALL:-"0"}
17+
1518
# Odoo Configuration file defaults
1619
ENV \
1720
ADMIN_PASSWORD=${ADMIN_PASSWORD:-my-weak-password} \

resources/entrypoint.sh

+8-6
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,16 @@ function getAddons() {
5959

6060
getAddons
6161

62-
if [ -z "$EXTRA_ADDONS_PATHS" ]
63-
then
64-
echo "The variable \$EXTRA_ADDONS_PATHS is empty, using default addons_path"
65-
echo "addons_path = $EXTRA_ADDONS_PATHS" >> $ODOO_RC
62+
if [ -z "$EXTRA_ADDONS_PATHS" ]; then
63+
echo "The variable \$EXTRA_ADDONS_PATHS is empty, using default addons_path"
64+
echo "addons_path = $EXTRA_ADDONS_PATHS" >> $ODOO_RC
6665
else
67-
echo "addons_path = $ODOO_ADDONS_BASEPATH,$EXTRA_ADDONS_PATHS" >> $ODOO_RC
66+
echo "addons_path = $ODOO_ADDONS_BASEPATH,$EXTRA_ADDONS_PATHS" >> $ODOO_RC
67+
68+
if [ "$PIP_AUTO_INSTALL" -eq "1" ]; then
69+
find $ODOO_EXTRA_ADDONS -name 'requirements.txt' -exec pip3 --no-cache-dir install --user -r {} \;
70+
fi
6871

69-
find $ODOO_EXTRA_ADDONS -name 'requirements.txt' -exec pip3 --no-cache-dir install --user -r {} \;
7072
fi
7173

7274
DB_ARGS=()

0 commit comments

Comments
 (0)