langflow-ai / langflow

⛓️ Langflow is a visual framework for building multi-agent and RAG applications. It's open-source, Python-powered, fully customizable, model and vector store agnostic.

Home Page:http://www.langflow.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Starting all from Docker image fails

tacass opened this issue · comments

Describe the bug
This is really two different issues, but I'll put them both here. To get the dockerized app to start I had to make this change in v1.0.0a23

diff --git a/docker-compose.yml b/docker-compose.yml
index c74447899..ed1cc0b42 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -13,7 +13,7 @@ services:
       - "7860:7860"
     volumes:
       - ./:/app
-    command: bash -c "uvicorn --factory src.backend.langflow.main:create_app --host 0.0.0.0 --port 7860 --reload"
+    command: bash -c "uvicorn --factory src.backend.base.langflow.main:create_app --host 0.0.0.0 --port 7860 --reload"
     networks:
       - langflow
   frontend:

I'm not an expert in asyncio in this context, but to allow it to run I made this change:

diff --git a/src/backend/base/langflow/main.py b/src/backend/base/langflow/main.py
index 81797dc80..eae68c961 100644
--- a/src/backend/base/langflow/main.py
+++ b/src/backend/base/langflow/main.py
@@ -38,7 +38,7 @@ def get_lifespan(fix_migration=False, socketio_server=None):
 
     @asynccontextmanager
     async def lifespan(app: FastAPI):
-        nest_asyncio.apply()
+
         # Startup message

Hey @tacass
Thanks for this!
The asyncio problem is that when running using uvicorn directly we need to pass --loop asyncio because of the nest_asyncio.

Now, if you just want to run Langflow in a docker container, you should use the logspace/langflow:1.0-alpha image.

If you want to build the docker image yourself, you should probably use langflow.main:create_app instead of thesrc.backend....

The Dockerfiles in the root folder are still in need of updates, that's why they don't work.

You can take a look in the docker_example folder for some more up-to-date examples.

Would you be willing to test this PR out? #1751

I won't be able to do it today, but I can take a look at it tomorrow. Did you intend to include -loop asyncio in the uvicorn launch in the docker version?

Would you be willing to test this PR out? #1751

It seems not working yet.

backend-1 | Error: Invalid value for '--loop': 'asyncio,' is not one of 'auto', 'asyncio', 'uvloop'.

I'm taking a look but there is a lot of Dockerfiles!

anyone solved the issue with docker compose for the whole stuff?