feat(docker): Headless 可选部署的 Dev-Tools 镜像与 Compose 配置 - #410
Open
thirsty5034 wants to merge 8 commits into
Open
Conversation
Replace direct AppHandle/State usage in the command layer with a plain AppContext assembly plus a typed event emitter, so the same business commands can run under both the desktop Tauri runtime and a headless server. Desktop-only modules are feature-gated behind the default desktop feature. Tests updated to assert the compat abstraction instead of the raw tauri runtime paths.
A --no-default-features build strips the Tauri desktop runtime and runs
the same command surface over an axum HTTP/WebSocket server: GET /health,
GET /api/status, POST /api/invoke, GET /ws event broadcast, GET /* WebUI
SPA fallback and /proxy/{provider}/ BFF routes. Adds a same-origin
security model (CORS gate, optional Bearer token auth, rate limiting by
real peer IP) and a runtime-fallback mode for browsers without the Tauri
bridge.
Add a tauriBridge module exposing the same invoke interface to the existing GUI code so the WebUI runs unchanged on the headless server (runtime-fallback over fetch/WebSocket). Adds HeadlessFolderPicker and headless-aware file upload. All GUI imports now go through the bridge instead of @tauri-apps/api directly.
scripts/manifest/commands.json is the committed source of truth for the 234 Tauri commands; build_type_map.py derives the Rust type map, gen_adapters.py regenerates commands/adapters.rs and verify_headless.py asserts headless.rs dispatch arms match the manifest both ways. The gen-verify CI job fails on any drift.
Add headless-rust (cargo check/test/build --no-default-features) and gen-verify (generator drift check) jobs. Document the headless security model and the command-registry workflow in the README.
Single Dockerfile.headless-tools with TARGET_PROFILE=minimal|core|full, multi-arch amd64/arm64, shared base layers. Runtimes are managed by mise (go/node/pnpm/bun/python; full adds Temurin 17 + Maven) and kept lean; missing versions auto-install on first boot against a named volume. Adds the liveagent-headless-tools GH Actions workflow to build and push the three images to GHCR (main push/tag/workflow_dispatch).
docker-compose.headless-{minimal,core,full}.yml and
docker-compose.gateway.yml with data + mise volumes, per-profile
environment, restart policy and network mode; entrypoint.sh wires mise
lazy install with a bounded timeout. README documents the quick-start,
runtime version switching via MISE_*_VERSION and volume requirements.
StackCairn
marked this pull request as draft
August 9, 2026 10:26
Contributor
|
PR governance checks passed. Awaiting human review. |
thirsty5034
marked this pull request as ready for review
August 9, 2026 10:27
5 tasks
Contributor
Author
|
已同步一个构建修复( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 issue
Resolves #380(Headless 运行时主体见 #409,本 PR 在其之上增加可选部署层)
概述
为 Headless 运行时提供可选的部署层:基于
mise构建分层 Dev-Tools 镜像(minimal/core/full),并提供 headless 与 gateway 的 docker-compose 配置。本 PR 叠加在运行时 PR(#409)之上,增量仅为 Docker/Compose 工具链(11 个文件)。改动范围
Dockerfile.headless-tools、docker/、.github/workflows/liveagent-headless-tools.ymlDockerfile.headless-tools— 分层构建(minimal → core → full),apt/npm 镜像加速(mirrors.tuna.tsinghua.edu.cn、npmmirror),便于国内网络快速构建docker/docker-compose.headless-{minimal,core,full}.yml— headless 服务器配置docker/docker-compose.gateway.yml— gateway 部署配置docker/mise.{core,full}.toml— 锁定工具链版本.github/workflows/liveagent-headless-tools.yml— 在 main 分支 push/tag 时构建并推送镜像到ghcr.nju.edu.cn(支持手动触发)主要亮点
liveagent-full+liveagent-minimal),会话数据完好截图 / 预览
基于构建镜像运行的 Headless WebUI(运行时见 #409):
验证情况
ghcr.nju.edu.cn/thirsty5034/liveagent-*(手动触发,feat-headless-pr-g与main标签均存在)docker compose up启动 full 镜像,WebUI 可访问,既有会话数据保留提交前检查