refactor: 统一 .env 配置 — 合并 backend/.env + .docker.env 到根目录

- Go 服务 godotenv.Load("../.env") → godotenv.Load("../../.env")
- ethend.sh/config.js 读取路径改为根目录 .env
- 删除 .docker.env.example 和 backend/.env.example,统一为 .env.example
- Docker compose 默认读取根 .env,无需 --env-file
- 同步更新全部文档

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 10:12:54 +08:00
parent 43d256e197
commit 46441335c0
12 changed files with 49 additions and 92 deletions
+2 -2
View File
@@ -14,10 +14,10 @@ const ROOT = path.resolve(__dirname, '../..');
const isWin = os.platform() === 'win32';
// 读取 backend/.env 文件,将值合并到 process.env(不覆盖已有的环境变量)
// 读取根目录 .env 文件,将值合并到 process.env(不覆盖已有的环境变量)
// 这样 ethend 启动各服务时能传递用户配置的凭据
function loadEnvFile() {
const envPath = path.join(ROOT, 'backend', '.env');
const envPath = path.join(ROOT, '.env');
try {
const content = fs.readFileSync(envPath, 'utf-8');
for (const line of content.split('\n')) {