From 123bdec15b448a191b3b3183c94e12caf8aa8955 Mon Sep 17 00:00:00 2001 From: Jakub Berezowski Date: Fri, 12 Feb 2021 22:41:13 +0100 Subject: [PATCH] issue-591: allows to specify different location of requirements.txt --- README.md | 1 + script/entrypoint.sh | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 922e51a7..aaad5366 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,7 @@ In order to incorporate plugins into your docker container - Create a file "requirements.txt" with the desired python modules - Mount this file as a volume `-v $(pwd)/requirements.txt:/requirements.txt` (or add it as a volume in docker-compose file) +- To mount the file in another location modify the `PIP_REQUIREMENTS_PATH` variable - The entrypoint.sh script execute the pip install command (with --user option) ## UI Links diff --git a/script/entrypoint.sh b/script/entrypoint.sh index 166f4837..df51ba10 100755 --- a/script/entrypoint.sh +++ b/script/entrypoint.sh @@ -23,9 +23,10 @@ export \ AIRFLOW__CORE__FERNET_KEY \ AIRFLOW__CORE__LOAD_EXAMPLES \ -# Install custom python package if requirements.txt is present -if [ -e "/requirements.txt" ]; then - $(command -v pip) install --user -r /requirements.txt +# Install custom python package if requirements.txt is present for the specified location +: "${PIP_REQUIREMENTS_PATH:="/requirements.txt"}" +if [ -e "$PIP_REQUIREMENTS_PATH" ]; then + $(command -v pip) install --user -r "$PIP_REQUIREMENTS_PATH" fi wait_for_port() {