forked from langflow-ai/langflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add docker to front and backend
- Loading branch information
Showing
18 changed files
with
375 additions
and
3,596 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,9 @@ | ||
# `python-base` sets up all our shared environment variables | ||
FROM python:3.10-slim | ||
|
||
# python | ||
ENV PYTHONUNBUFFERED=1 \ | ||
# prevents python creating .pyc files | ||
PYTHONDONTWRITEBYTECODE=1 \ | ||
\ | ||
# pip | ||
PIP_NO_CACHE_DIR=off \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=on \ | ||
PIP_DEFAULT_TIMEOUT=100 \ | ||
\ | ||
# poetry | ||
# https://python-poetry.org/docs/configuration/#using-environment-variables | ||
POETRY_VERSION=1.3.2 \ | ||
# make poetry install to this location | ||
POETRY_HOME="/opt/poetry" \ | ||
# make poetry create the virtual environment in the project's root | ||
# it gets named `.venv` | ||
POETRY_VIRTUALENVS_IN_PROJECT=true \ | ||
# do not ask any interactive question | ||
POETRY_NO_INTERACTION=1 \ | ||
\ | ||
# paths | ||
# this is where our requirements + virtual environment will live | ||
PYSETUP_PATH="/opt/pysetup" \ | ||
VENV_PATH="/opt/pysetup/.venv" | ||
|
||
# prepend poetry and venv to path | ||
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH" | ||
|
||
RUN apt-get update \ | ||
&& apt-get install --no-install-recommends -y \ | ||
# deps for installing poetry | ||
curl \ | ||
# deps for building python deps | ||
build-essential libpq-dev | ||
|
||
# install poetry - respects $POETRY_VERSION & $POETRY_HOME | ||
RUN curl -sSL https://install.python-poetry.org | python3 - | ||
|
||
# copy project requirement files here to ensure they will be cached. | ||
WORKDIR $PYSETUP_PATH | ||
COPY poetry.lock pyproject.toml ./ | ||
|
||
# install runtime deps - uses $POETRY_VIRTUALENVS_IN_PROJECT internally | ||
RUN poetry install --only-root | ||
RUN poetry add "git+https://github.com/ibiscp/langchain.git@ibis" | ||
|
||
WORKDIR /app | ||
|
||
ENV PATH="/opt/pysetup/.venv/bin:$PATH" | ||
|
||
COPY src/ . | ||
COPY --from=frontend_build /app/build/ / | ||
|
||
EXPOSE 80 | ||
|
||
CMD [ "uvicorn", "--host", "0.0.0.0", "--port", "80", "app:app" ] | ||
# CMD [ "langchain" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#! /bin/bash | ||
|
||
docker build -t logspace/frontend_build -f build.Dockerfile . | ||
poetry remove langchain | ||
docker build -t ibiscp/expert:v0.0.15 . && docker push ibiscp/expert:v0.0.15 | ||
poetry add --editable ../langchain | ||
VERSION=$(toml get --toml-path pyproject.toml tool.poetry.version) | ||
docker build --build-arg VERSION=$VERSION -t ibiscp/langflow:$VERSION . && docker push ibiscp/langflow:$VERSION | ||
poetry add --editable ../../../langchain |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM logspace/backend_build as backend_build | ||
|
||
FROM python:3.10-slim | ||
WORKDIR /app | ||
|
||
RUN apt-get update && apt-get install git -y | ||
|
||
COPY --from=backend_build /app/dist/*.whl /app/ | ||
RUN pip install langflow-0.0.17-py3-none-any.whl | ||
RUN rm *.whl | ||
|
||
EXPOSE 80 | ||
|
||
CMD [ "uvicorn", "--host", "0.0.0.0", "--port", "80", "langflow.backend.app:app" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# `python-base` sets up all our shared environment variables | ||
FROM python:3.10-slim | ||
|
||
# python | ||
ENV PYTHONUNBUFFERED=1 \ | ||
# prevents python creating .pyc files | ||
PYTHONDONTWRITEBYTECODE=1 \ | ||
\ | ||
# pip | ||
PIP_NO_CACHE_DIR=off \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=on \ | ||
PIP_DEFAULT_TIMEOUT=100 \ | ||
\ | ||
# poetry | ||
# https://python-poetry.org/docs/configuration/#using-environment-variables | ||
POETRY_VERSION=1.4.0 \ | ||
# make poetry install to this location | ||
POETRY_HOME="/opt/poetry" \ | ||
# make poetry create the virtual environment in the project's root | ||
# it gets named `.venv` | ||
POETRY_VIRTUALENVS_IN_PROJECT=true \ | ||
# do not ask any interactive question | ||
POETRY_NO_INTERACTION=1 \ | ||
\ | ||
# paths | ||
# this is where our requirements + virtual environment will live | ||
PYSETUP_PATH="/opt/pysetup" \ | ||
VENV_PATH="/opt/pysetup/.venv" | ||
|
||
# prepend poetry and venv to path | ||
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH" | ||
|
||
RUN apt-get update \ | ||
&& apt-get install --no-install-recommends -y \ | ||
# deps for installing poetry | ||
curl \ | ||
# deps for building python deps | ||
build-essential libpq-dev | ||
|
||
# install poetry - respects $POETRY_VERSION & $POETRY_HOME | ||
RUN curl -sSL https://install.python-poetry.org | python3 - | ||
|
||
# copy project requirement files here to ensure they will be cached. | ||
WORKDIR /app | ||
COPY poetry.lock pyproject.toml ./ | ||
|
||
# install runtime deps - uses $POETRY_VIRTUALENVS_IN_PROJECT internally | ||
RUN poetry install --without dev | ||
RUN poetry add "git+https://github.com/ibiscp/langchain.git#ibis" | ||
|
||
COPY *.py langflow/backend/ | ||
RUN rm langflow/backend/dev.py | ||
|
||
RUN poetry build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#! /bin/bash | ||
|
||
poetry remove langchain | ||
docker build -t logspace/backend_build -f build.Dockerfile . | ||
VERSION=$(toml get --toml-path pyproject.toml tool.poetry.version) | ||
docker build --build-arg VERSION=$VERSION -t logspace/langflow_backend:$VERSION . | ||
# docker push logspace/langflow_backend:$VERSION | ||
# poetry add --editable ../../../langchain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import uvicorn | ||
import sys | ||
from pathlib import Path | ||
|
||
path = Path(__file__) | ||
sys.path.append(str(path.parent.parent.parent)) | ||
|
||
from app import app | ||
|
||
uvicorn.run(app, host="0.0.0.0", port=5003) |
Oops, something went wrong.