Update Dockerfiles, main.py, constants.py, and package versions (#1691)

* Update Dockerfiles to include user creation and use --user flag for pip install

* Add JavaScriptMIMETypeMiddleware to main.py

* Update constants.py and run.py files

* Update package versions in poetry.lock and pyproject.toml files

* Refactor Dockerfile to optimize image building process

* Fix import error in main.py

* Update Dockerfiles to use logspace/langflow image
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-04-12 16:39:22 -03:00 • committed by GitHub
commit 1a021321a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 31 additions and 123 deletions

View file

@ -63,8 +63,10 @@ RUN --mount=type=cache,target=/root/.cache \
# copy project requirement files here to ensure they will be cached.
WORKDIR $PYSETUP_PATH
# Copy just one file to avoid rebuilding the whole image
COPY poetry.lock pyproject.toml ./
COPY ./src/backend/langflow/main.py ./src/backend/langflow/main.py
COPY ./src/backend/langflow ./src/backend/langflow
COPY ./src/backend/base/pyproject.toml ./src/backend/base/pyproject.toml
# Copy README.md to the build context
COPY README.md .
# install runtime deps - uses $POETRY_VIRTUALENVS_IN_PROJECT internally
@ -84,7 +86,7 @@ COPY --from=builder-base $POETRY_HOME $POETRY_HOME
COPY --from=builder-base $PYSETUP_PATH $PYSETUP_PATH
# Copy just one file to avoid rebuilding the whole image
COPY ./src/backend/langflow/__init__.py ./src/backend/langflow/__init__.py
COPY ./src/backend/langflow ./src/backend/langflow
# quicker install as runtime deps are already installed
RUN --mount=type=cache,target=/root/.cache \
poetry install --with=dev --extras deploy