diff --git a/.env.template b/.env.template index 32dadf90..aab00bf3 100644 --- a/.env.template +++ b/.env.template @@ -4,6 +4,8 @@ SAVE_DIR=./saves # region model_provider # 推荐使用硅基流动免费服务 SILICONFLOW_API_KEY= +# 获取搜索服务的 api key 请访问 https://app.tavily.com/ +TAVILY_API_KEY= # # 其余可选配置 # OPENAI_API_KEY= @@ -15,9 +17,6 @@ SILICONFLOW_API_KEY= # TOGETHER_API_KEY= # # endregion model_provider -# # 功能服务 -# TAVILY_API_KEY= - # # 基础配置示例 # MYSQL_HOST=192.168.1.100 # MYSQL_USER=username diff --git a/docker-compose.yml b/docker-compose.yml index a6430da3..26a47f51 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: args: HTTP_PROXY: ${HTTP_PROXY:-} HTTPS_PROXY: ${HTTPS_PROXY:-} - image: yuxi-api:0.3.dev + image: yuxi-api:0.4.dev container_name: api-dev working_dir: /app volumes: @@ -62,7 +62,7 @@ services: context: . dockerfile: docker/web.Dockerfile target: development - image: yuxi-web:0.3.dev + image: yuxi-web:0.4.dev container_name: web-dev volumes: - ./web/src:/app/src diff --git a/docker/pull_image.ps1 b/docker/pull_image.ps1 new file mode 100644 index 00000000..c91ab218 --- /dev/null +++ b/docker/pull_image.ps1 @@ -0,0 +1,56 @@ +param( + [Parameter(Mandatory=$true)] + [string]$ImageTag +) + +# 当命令失败时,立即退出脚本 +$ErrorActionPreference = "Stop" + +Write-Host "Pulling image: $ImageTag" -ForegroundColor Green + +# 计算斜杠数量来确定镜像格式 +$slashCount = ($ImageTag -split '/' | Measure-Object).Count - 1 + +# 根据镜像格式设置镜像 URL +switch ($slashCount) { + 0 { + # 无前缀 (例如: python:3.12-slim) + $mirrorUrl = "m.daocloud.io/docker.io/library" + Write-Host "Image format: Official image (no prefix)" -ForegroundColor Cyan + } + 1 { + # 一个前缀 (例如: milvusdb/milvus:latest) + $mirrorUrl = "m.daocloud.io/docker.io" + Write-Host "Image format: Hub repository (one prefix)" -ForegroundColor Cyan + } + default { + # 两个或更多前缀 (例如: quay.io/coreos/etcd:v3.5.5) + $mirrorUrl = "m.daocloud.io" + Write-Host "Image format: Third-party registry (multiple prefixes)" -ForegroundColor Cyan + } +} + +$fullMirrorUrl = "$mirrorUrl/$ImageTag" +Write-Host "Mirror URL: $fullMirrorUrl" -ForegroundColor Yellow + +try { + # 从镜像加速器拉取镜像 + Write-Host "Step 1: Pulling image from mirror..." -ForegroundColor Blue + docker pull $fullMirrorUrl + + # 重新标记为原始名称 + Write-Host "Step 2: Tagging image with original name..." -ForegroundColor Blue + docker tag $fullMirrorUrl $ImageTag + + # 删除镜像加速器标签 + Write-Host "Step 3: Removing mirror tag..." -ForegroundColor Blue + docker rmi $fullMirrorUrl + + Write-Host "`nProcess completed successfully!" -ForegroundColor Green + Write-Host "`nCurrent Docker images:" -ForegroundColor Yellow + docker images + +} catch { + Write-Host "`nError occurred: $_" -ForegroundColor Red + exit 1 +} \ No newline at end of file diff --git a/docs/latest/changelog/faq.md b/docs/latest/changelog/faq.md index ec486799..8bc00c53 100644 --- a/docs/latest/changelog/faq.md +++ b/docs/latest/changelog/faq.md @@ -5,7 +5,9 @@ ## Docker与启动相关问题 ### 镜像拉取/构建失败? -镜像拉取:可使用 `docker/pull_image.sh` 辅助拉取 +镜像拉取:可使用以下脚本辅助拉取 +- **Linux/macOS**: `docker/pull_image.sh` +- **Windows PowerShell**: `docker/pull_image.ps1` 构建失败:若配置了代理仍失败,可尝试以下步骤: 1. 注释 `api.Dockerfile` 中的代理环境变量设置: ```dockerfile diff --git a/docs/latest/intro/quick-start.md b/docs/latest/intro/quick-start.md index efe8db2b..5a8e8b4b 100644 --- a/docs/latest/intro/quick-start.md +++ b/docs/latest/intro/quick-start.md @@ -90,7 +90,11 @@ docker logs web-dev -f 如果拉取镜像失败,可以尝试手动拉取: ```bash +# Linux/macOS bash docker/pull_image.sh python:3.11-slim + +# Windows PowerShell +powershell -ExecutionPolicy Bypass -File docker/pull_image.ps1 python:3.11-slim ``` **离线部署方案**: diff --git a/src/config/static/info.template.yaml b/src/config/static/info.template.yaml index d13f6c77..ddda9e0a 100644 --- a/src/config/static/info.template.yaml +++ b/src/config/static/info.template.yaml @@ -50,4 +50,4 @@ actions: # 页脚信息 footer: - copyright: "© 江南语析 2025 v0.3.0" + copyright: "© 江南语析 2025 v0.4.0"