fix: correctly load environment variables in docker-compose / fix: docker-compose 正确加载环境变量
What's Changed
This PR fixes a critical issue where environment variables from the .env file were not being correctly loaded by the services when running docker-compose up.
How was this fixed?
The following changes were made to docker-compose.yml:
- For the
bettafishservice:- Added the env_file: - .env directive to ensure it loads all required environment variables from the .env file.
修复了什么
本 PR 修复了一个关键问题:在使用 docker-compose up 启动时,服务无法从 .env 文件中正确加载环境变量。
如何修复的?
对 docker-compose.yml 文件进行了如下修改:
- 针对
bettafish服务:- 添加了 env_file: - .env 指令,以确保它能从 .env 文件加载所有必要的环境变量。
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
这并不是一个bug,以这种方式修复会导致配置内修改配置的方式无效。
我也遇到了这个问题,
在使用 docker-compose up 启动时,服务无法从 .env 文件中正确加载环境变量。
目前通过docker-compose up 访问http://localhost:5000 时会弹出界面【LLM 配置 - 与.env文件双向同步】同时并未加载个人创建的.env 配置文件内容
如图红箭头所示的地方,都为默认配置/或为空/而非env 文件内容。
可以用 #322 修复