chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

Kubernetes deployment - is there a way to deploy in a prefix in the URL?

Open PrashantSaikia opened this issue 11 months ago • 6 comments

My Chainlit app builds and runs in Docker, so I went ahead to deploy it in our AWS Kubernetes cluster. And although it deployed without any error, when I go to the URL, it displays a blank page. So I dug a bit more, and I saw that we are getting 404 in the proxy and I can see the website by using k8s port forwarding. This tells me that the Chainlit app is convinced it is deployed at https://baseurl.com/, when it is actually deployed at https://baseurl.com/chatbot.

So I guess my question is, how do I configure Chainlit to let it know about a prefix in the URL?

PrashantSaikia avatar Feb 28 '24 14:02 PrashantSaikia

We have the same Problem that there is no configuration for a baseUrlPath. Is something like that planned? Especially if you have a Kubernetes environment, something like that is essential.

mschuch avatar Mar 07 '24 09:03 mschuch

@PrashantSaikia, are you able to view the deployment at https://baseurl.com/? In our case https://baseurl.com/chatbot & https://baseurl.com/ both display a blank page.

atrakriv avatar Mar 12 '24 19:03 atrakriv

@atrakriv No, it won't work. Chainlit, as of now, always has this structure of https://baseurl/app where app is coming from your chainlit run file (i.e., app.py). If you name it as chatbot.py, the app will be available at https://baseurl/chatbot. You can then further write some logic to redirect https://baseurl to point to https://baseurl/app. But for that, you will first need to deploy the app at https://baseurl/app.

I ended up having to rewrite my app from scratch in a framework that does support subdirectory deployment (Holoviz Panel in this particular case). It's a shame really, as I find the Chainlit UI to be more pleasing and it also has some features that Panel doesn't.

PrashantSaikia avatar Mar 12 '24 20:03 PrashantSaikia

I see. Thanks, @PrashantSaikia.

atrakriv avatar Mar 13 '24 04:03 atrakriv

Hi @PrashantSaikia - I am trying to deploy chainlit in k8.

I am getting a white screen I tried https://baseurl/app .

Note: I am also new to k8 .

Vighnesh1234 avatar Mar 16 '24 00:03 Vighnesh1234

I'm also facing the same issue. I'm trying to deploy a Chainlit app on Kubernetes, but it's proving difficult due to the lack of support for subdirectory deployment.

As mentioned in https://github.com/Chainlit/chainlit/issues/524, this seems to be a current limitation of Chainlit that is hard to work around.

mobmobhask avatar Mar 25 '24 12:03 mobmobhask