feat: 新增 scripts 一键脚本与 YAML 配置生成 env

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Nixevol
2026-06-28 18:41:52 +08:00
co-authored by Cursor
parent b5170fe84b
commit 631982d980
7 changed files with 351 additions and 1 deletions
+32
View File
@@ -0,0 +1,32 @@
# /// script
# requires-python = ">=3.9"
# dependencies = ["pyyaml"]
# ///
"""构建 Docker 镜像:生成 .env -> 安装依赖 -> 构建前端静态 -> 构建 API 镜像。
用法:uv run scripts/docker_build.py
"""
from __future__ import annotations
from _lib import build_env, load_config, run, write_env
COMPOSE = "docker compose --env-file .env -f docker/docker-compose.full.yml"
def main() -> None:
cfg = load_config()
write_env(build_env(cfg))
# 安装依赖并构建前端静态(供 Nginx 挂载)
run("pnpm install")
run("pnpm build:shared")
run("pnpm --filter @artveris/admin build")
run("pnpm --filter @artveris/h5 build")
# 构建 API 镜像
run(f"{COMPOSE} build")
print("[artveris] 镜像构建完成。运行:uv run scripts/docker_dev.py")
if __name__ == "__main__":
main()