Is it possible to modify it so that .env.local environment variables are set at runtime?
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?
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!
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 ?
I agree too. Baking environment variables directly into a Docker image leads to bad practices:
- Lack of Flexibility
- Security Risks
- Portability Issues
Opened a PR for this, needs a rebase but I'm waiting on someone to have time to review it.