From 5d75d930bd34d3eceb011442ade608142b0d9728 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 12 Apr 2024 15:09:43 -0300 Subject: [PATCH] Update Dockerfiles to include user creation and use --user flag for pip install --- build_and_push.Dockerfile | 7 ++++--- build_and_push_base.Dockerfile | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/build_and_push.Dockerfile b/build_and_push.Dockerfile index 1c595e180..f552dd695 100644 --- a/build_and_push.Dockerfile +++ b/build_and_push.Dockerfile @@ -74,10 +74,11 @@ RUN $POETRY_HOME/bin/poetry build FROM python-base as final # Copy virtual environment and built .tar.gz from builder base +RUN useradd -m -u 1000 user COPY --from=builder-base /app/dist/*.tar.gz ./ - # Install the package from the .tar.gz -RUN pip install *.tar.gz +RUN python -m pip install *.tar.gz --user WORKDIR /app -CMD ["python", "-m", "langflow", "run", "--host", "0.0.0.0", "--port", "7860"] +ENTRYPOINT ["python", "-m", "langflow", "run"] +CMD ["--host", "0.0.0.0", "--port", "7860"] \ No newline at end of file diff --git a/build_and_push_base.Dockerfile b/build_and_push_base.Dockerfile index f5092c81c..db6d0cf58 100644 --- a/build_and_push_base.Dockerfile +++ b/build_and_push_base.Dockerfile @@ -82,10 +82,11 @@ RUN cd src/backend/base && $POETRY_HOME/bin/poetry build --format sdist FROM python-base as final # Copy virtual environment and built .tar.gz from builder base +RUN useradd -m -u 1000 user COPY --from=builder-base /app/src/backend/base/dist/*.tar.gz ./ - # Install the package from the .tar.gz -RUN pip install *.tar.gz +RUN pip install *.tar.gz --user WORKDIR /app -CMD ["python", "-m", "langflow", "run", "--host", "0.0.0.0", "--port", "7860"] +ENTRYPOINT ["python", "-m", "langflow", "run"] +CMD ["--host", "0.0.0.0", "--port", "7860"] \ No newline at end of file