fix: 修复Docker全栈部署配置
This commit is contained in:
@@ -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()]
|
||||
|
||||
Reference in New Issue
Block a user