From 70f69b06836c7ff49164240a56e24ecaa53b7037 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 3 Aug 2026 18:49:17 +0000 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=20Docker=20=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=20Web=20=E6=B5=8B=E8=AF=95=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: multica-agent --- README.md | 29 +++++++++++++++++++++++++++++ compose.yaml | 6 ++++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b6b074a..31089d9 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,35 @@ docker compose run --rm test docker compose run --rm build ``` +## Docker 启动 Web 测试服务 + +构建镜像并在后台启动: + +```bash +docker compose up --build -d +``` + +浏览器访问 。查看状态和日志: + +```bash +docker compose ps +docker compose logs -f web +``` + +停止服务: + +```bash +docker compose down +``` + +默认只监听本机回环地址。需要让局域网测试设备访问时,显式设置监听地址和端口: + +```bash +WEB_BIND_ADDRESS=0.0.0.0 WEB_PORT=1420 docker compose up --build -d +``` + +开放到局域网前请确认主机防火墙和测试网络范围;Web 预览不包含认证能力。 + ## 当前范围 - 展示多 Teamserver 连接状态和独立工作区。 diff --git a/compose.yaml b/compose.yaml index e8b8efc..bb07bcf 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,5 +1,6 @@ services: test: + profiles: ["tools"] build: context: . target: test @@ -8,15 +9,16 @@ services: security_opt: - no-new-privileges:true build: + profiles: ["tools"] build: context: . target: build - preview: + web: build: context: . target: preview ports: - - "127.0.0.1:8080:8080" + - "${WEB_BIND_ADDRESS:-127.0.0.1}:${WEB_PORT:-1420}:8080" read_only: true tmpfs: - /tmp