From 298e499f72605e8fa456e0fe97c05cc393986ad7 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 18 Aug 2023 10:09:45 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20feat(base.Dockerfile):=20copy=20?= =?UTF-8?q?specific=20file=20'main.py'=20from=20src/backend/langflow=20to?= =?UTF-8?q?=20improve=20build=20performance=20and=20reduce=20unnecessary?= =?UTF-8?q?=20copying=20=F0=9F=90=9B=20fix(base.Dockerfile):=20fix=20copyi?= =?UTF-8?q?ng=20of=20src/backend=20directory=20to=20ensure=20all=20files?= =?UTF-8?q?=20are=20included=20in=20the=20build=20context?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base.Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/base.Dockerfile b/base.Dockerfile index 632a0fb46..c608e8c99 100644 --- a/base.Dockerfile +++ b/base.Dockerfile @@ -54,6 +54,7 @@ RUN apt-get update \ # deps for building python deps build-essential + # install poetry - respects $POETRY_VERSION & $POETRY_HOME # The --mount will mount the buildx cache directory to where # Poetry and Pip store their cache so that they can re-use it @@ -63,7 +64,7 @@ RUN --mount=type=cache,target=/root/.cache \ # copy project requirement files here to ensure they will be cached. WORKDIR $PYSETUP_PATH COPY poetry.lock pyproject.toml ./ -COPY ./src/backend ./src/backend +COPY ./src/backend/langflow/main.py ./src/backend/langflow/main.py # Copy README.md to the build context COPY README.md . # install runtime deps - uses $POETRY_VIRTUALENVS_IN_PROJECT internally @@ -82,6 +83,7 @@ WORKDIR $PYSETUP_PATH COPY --from=builder-base $POETRY_HOME $POETRY_HOME COPY --from=builder-base $PYSETUP_PATH $PYSETUP_PATH +COPY ./src/backend ./src/backend # quicker install as runtime deps are already installed RUN --mount=type=cache,target=/root/.cache \ poetry install --with=dev --extras deploy