chainlit
chainlit copied to clipboard
Kubernetes deployment - is there a way to deploy in a prefix in the URL?
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?
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.
@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 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.
I see. Thanks, @PrashantSaikia.
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 .
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.