From 7866cd50734c59f5ccf3eda8564c7582e30089ae Mon Sep 17 00:00:00 2001 From: Massimiliano Pippi Date: Wed, 6 Mar 2024 14:48:29 +0100 Subject: [PATCH] make pipelines-dir and additional-python-path pluggable --- docker/Dockerfile | 10 +++++++++- docker/docker-bake.hcl | 14 ++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index e411721..bdf8942 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -26,8 +26,16 @@ FROM $base_image AS final COPY --from=build-image /opt/venv /opt/venv +ARG pipelines_dir +RUN mkdir -p $pipelines_dir +ENV HAYHOOKS_PIPELINES_DIR=$pipelines_dir + +ARG additional_python_path +RUN mkdir -p $additional_python_path +ENV HAYHOOKS_ADDITIONAL_PYTHONPATH=$additional_python_path + EXPOSE 1416 ENV PATH="/opt/venv/bin:$PATH" -CMD ["hayhooks", "run", "--host", "0.0.0.0", "--port", "1416"] +CMD ["hayhooks", "run", "--host", "0.0.0.0"] diff --git a/docker/docker-bake.hcl b/docker/docker-bake.hcl index e7e414d..ef835c9 100644 --- a/docker/docker-bake.hcl +++ b/docker/docker-bake.hcl @@ -2,10 +2,6 @@ variable "HAYHOOKS_VERSION" { default = "main" } -variable "GITHUB_REF" { - default = "" -} - variable "IMAGE_NAME" { default = "deepset/hayhooks" } @@ -14,8 +10,12 @@ variable "IMAGE_TAG_SUFFIX" { default = "local" } -variable "BASE_IMAGE_TAG_SUFFIX" { - default = "local" +variable "PIPELINES_DIR" { + default = "/opt/pipelines" +} + +variable "ADDITIONAL_PYTHON_PATH" { + default = "/opt/custom-components" } target "default" { @@ -25,6 +25,8 @@ target "default" { build_image = "deepset/haystack:base-main" base_image = "deepset/haystack:base-main" hayhooks_version = "${HAYHOOKS_VERSION}" + pipelines_dir = "${PIPELINES_DIR}" + additional_python_path = "${ADDITIONAL_PYTHON_PATH}" } platforms = ["linux/amd64", "linux/arm64"] }