fix: 修复Docker全栈部署配置

This commit is contained in:
Nixevol
2026-07-05 08:12:20 +08:00
parent f496300829
commit a0ccf3805b
9 changed files with 67 additions and 5 deletions
+18
View File
@@ -138,6 +138,24 @@ def build_env(cfg: dict) -> dict[str, str]:
return env
def build_full_stack_env(cfg: dict) -> dict[str, str]:
"""Build .env values for docker-compose.full.yml local full-stack runs."""
env = build_env(cfg)
env.update(
{
"NODE_ENV": "production",
# In the full-stack compose, Nginx is the public entrypoint:
# admin/API/short-link on :80, client on :8080.
"BASE_URL": "http://localhost",
"ADMIN_ORIGIN": "http://localhost",
"CLIENT_ORIGIN": "http://localhost:8080",
"TRACE_URL_TEMPLATE": "http://localhost:8080/#/trace/{code}",
"BACKUP_DIR": "/app/apps/api/backups",
}
)
return env
def write_env(env: dict[str, str], path: Path | None = None) -> None:
path = path or (ROOT / ".env")
lines = [f"{k}={v}" for k, v in env.items()]