chat-ui icon indicating copy to clipboard operation
chat-ui copied to clipboard

Is it possible to modify it so that .env.local environment variables are set at runtime?

Open martinkozle opened this issue 2 years ago • 4 comments

Currently for every different deployment of Chat-UI it is required to rebuild the Docker image with different .env.local environment variables. Is it theoretically possible to have it so that 1 image can be used for all deployments, but with different secrets passed at runtime? What environment variables and for what reason are truly needed at build time for Chat-UI to function? In #204 it says HF_ACCESS_TOKEN is needed at build time, but what if we use OPENID authentication instead? Is there anything else blocking this type of use case?

martinkozle avatar Aug 31 '23 12:08 martinkozle

Yeah it's kind of annoying, I agree. I think you would need to replace the secrets from $env/static/private to $env/dynamic/private. Not sure what the side effects would be, but I can't see why this should change anything. It could be worth trying!

nsarrazin avatar Sep 11 '23 07:09 nsarrazin

Double this. Idea: Can this potentially be solved by dumping the os.env > .env.local using a script as in https://github.com/bodaay/HuggingChatAllInOne ?

michaelfeil avatar Sep 22 '23 08:09 michaelfeil

I agree too. Baking environment variables directly into a Docker image leads to bad practices:

  • Lack of Flexibility
  • Security Risks
  • Portability Issues

haje01 avatar Nov 29 '23 02:11 haje01

Opened a PR for this, needs a rebase but I'm waiting on someone to have time to review it.

zacps avatar Mar 14 '24 20:03 zacps