fix(docker): multi-theme packaging with PS1 orchestration and full bundle export

Replace all-themes bat logic with PowerShell to survive branch checkout; add api-admin and full-themes service modes; fix bat findstr path check and cmd exit codes; document six-in-one tar and update gitignore for player/full-themes artifacts.
This commit is contained in:
2026-06-24 14:18:31 +08:00
parent 25dd0cf514
commit 9c5e8d6f5c
8 changed files with 425 additions and 298 deletions

View File

@@ -20,7 +20,8 @@
| `docs/docker/build-and-export-player-theme-3.bat` | Windows仅 theme-3 移动主题,自动切分支) |
| `docs/docker/build-and-export-player-theme-4.bat` | Windows仅 theme-4 海军蓝极简,自动切分支) |
| `docs/docker/build-and-export-admin.bat` | Windows仅 admin可双击 |
| `docs/docker/build-and-export-all-themes.bat` | Windows**四套主题 player 一键打包**,自动切分支) |
| `docs/docker/build-and-export-all-themes.ps1` | Windows**四套主题 player 一键打包**,自动切分支,推荐 |
| `docs/docker/build-and-export-all-themes.bat` | Windows同上薄包装启动器双击可用 |
| `docs/docker/build-and-export-images.ps1` | WindowsPowerShell |
| `docs/docker/build-and-export-images.sh` | Linux / macOS / Git Bash |
@@ -131,18 +132,27 @@ docs\docker\build-and-export-images.bat --export-only
脚本会自动:切到各主题分支 → 构建 player 镜像 → 导出 tar → 切回原分支 → 构建 api/admin。
```bat
> **为何用 PowerShell** 本脚本仅存在于 `main` 分支;执行过程中会 `git checkout theme-*`CMD 批处理会从磁盘逐行读取切分支后脚本文件消失会导致中断。PowerShell 启动时已将整份脚本载入内存,可安全跨分支执行。`.bat` 仅为薄包装,内部转调 `.ps1`。
```powershell
cd C:\path\to\thebet365
.\docs\docker\build-and-export-all-themes.ps1
```
或双击 / CMD
```bat
docs\docker\build-and-export-all-themes.bat
```
可选参数:
可选参数PowerShell 与 bat 均支持)
| 参数 | 说明 |
|------|------|
| `--use-cache` | 使用 Docker 层缓存,加快重复构建速度 |
| `--export-only` | 跳过构建,仅导出本地已有镜像 |
| `--skip-api-admin` | 只打四套 player跳过 api/admin |
| `-UseCache` / `--use-cache` | 使用 Docker 层缓存,加快重复构建速度 |
| `-ExportOnly` / `--export-only` | 跳过构建,仅导出本地已有镜像 |
| `-SkipApiAdmin` / `--skip-api-admin` | 只打四套 player跳过 api/admin |
| `-SkipBundle` / `--skip-bundle` | 跳过六合一包,仅保留分散 tar |
### 产物
@@ -153,6 +163,13 @@ docs\docker\build-and-export-all-themes.bat
| `thebet365-player-theme-3.tar` | `thebet365-player:theme-3` |
| `thebet365-player-theme-4.tar` | `thebet365-player:theme-4` |
| `thebet365-images-latest.tar` | `thebet365-api:latest` + `thebet365-admin:latest` |
| **`thebet365-full-themes-latest.tar`** | **上面全部 6 个镜像(上传这一个即可)** |
也可单独导出六合一包(本地镜像已齐时):
```bat
docs\docker\build-and-export-images.bat --service full-themes --export-only --tag latest
```
### 分支要求