BettaFish icon indicating copy to clipboard operation
BettaFish copied to clipboard

fix: correctly load environment variables in docker-compose / fix: docker-compose 正确加载环境变量

Open CaptainUnhappy opened this issue 2 months ago • 3 comments

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 bettafish service:
    • 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 文件加载所有必要的环境变量。

CaptainUnhappy avatar Nov 12 '25 02:11 CaptainUnhappy

这并不是一个bug,以这种方式修复会导致配置内修改配置的方式无效。

DoiiarX avatar Nov 12 '25 04:11 DoiiarX

我也遇到了这个问题, 在使用 docker-compose up 启动时,服务无法从 .env 文件中正确加载环境变量。 目前通过docker-compose up 访问http://localhost:5000 时会弹出界面【LLM 配置 - 与.env文件双向同步】同时并未加载个人创建的.env 配置文件内容 image 如图红箭头所示的地方,都为默认配置/或为空/而非env 文件内容。

可以用 #322 修复

JasonDylan avatar Nov 12 '25 06:11 JasonDylan