From 3f09d60cdc48308a643a847c350eae888a68dde0 Mon Sep 17 00:00:00 2001 From: AYANGarch Date: Thu, 26 Feb 2026 22:54:50 +0800 Subject: [PATCH] feat(zeabur): add one-click deploy template --- DEPLOY.en.md | 12 +++++++++++ DEPLOY.md | 12 +++++++++++ README.MD | 7 ++++++ README.en.md | 7 ++++++ zeabur.yaml | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 98 insertions(+) create mode 100644 zeabur.yaml diff --git a/DEPLOY.en.md b/DEPLOY.en.md index 2ff3250..127696a 100644 --- a/DEPLOY.en.md +++ b/DEPLOY.en.md @@ -175,6 +175,18 @@ If container logs look normal but the admin panel is unreachable, check these fi 1. **Port alignment**: when `PORT` is not `5001`, use the same port in your URL (for example `http://localhost:8080/admin`). 2. **WebUI assets in dev compose**: `docker-compose.dev.yml` runs `go run` in a dev image and does not auto-install Node.js inside the container; if `static/admin` is missing in your repo, `/admin` will return 404. Build once on host: `./scripts/build-webui.sh`. +### 2.7 Zeabur One-Click (Dockerfile) + +This repo includes a `zeabur.yaml` template for one-click deployment on Zeabur: + +[![Deploy on Zeabur](https://zeabur.com/button.svg)](https://zeabur.com/templates/L4CFHP) + +Notes: + +- **Port**: DS2API listens on `5001` by default; the template sets `PORT=5001`. +- **Persistent config**: the template mounts `/data` and sets `DS2API_CONFIG_PATH=/data/config.json`. After importing config in Admin UI, it will be written and persisted to this path. +- **First login**: after deployment, open `/admin` and login with `DS2API_ADMIN_KEY` shown in Zeabur env/template instructions (recommended: rotate to a strong secret after first login). + --- ## 3. Vercel Deployment diff --git a/DEPLOY.md b/DEPLOY.md index d7d74d3..2df4238 100644 --- a/DEPLOY.md +++ b/DEPLOY.md @@ -175,6 +175,18 @@ healthcheck: 1. **端口是否一致**:`PORT` 改成非 `5001` 时,访问地址也要改成对应端口(如 `http://localhost:8080/admin`)。 2. **开发 compose 的 WebUI 静态文件**:`docker-compose.dev.yml` 使用 `go run` 开发镜像,不会在容器内自动安装 Node.js;若仓库里没有 `static/admin`,`/admin` 会返回 404。可先在宿主机构建一次:`./scripts/build-webui.sh`。 +### 2.7 Zeabur 一键部署(Dockerfile) + +仓库提供 `zeabur.yaml` 模板,可在 Zeabur 上一键部署: + +[![Deploy on Zeabur](https://zeabur.com/button.svg)](https://zeabur.com/templates/L4CFHP) + +部署要点: + +- **端口**:服务默认监听 `5001`,模板会固定设置 `PORT=5001`。 +- **配置持久化**:模板挂载卷 `/data`,并设置 `DS2API_CONFIG_PATH=/data/config.json`;在管理台导入配置后,会写入并持久化到该路径。 +- **首次登录**:部署完成后访问 `/admin`,使用 Zeabur 环境变量/模板指引中的 `DS2API_ADMIN_KEY` 登录(建议首次登录后自行更换为强密码)。 + --- ## 三、Vercel 部署 diff --git a/README.MD b/README.MD index b8c3be0..43d1270 100644 --- a/README.MD +++ b/README.MD @@ -5,6 +5,7 @@ ![Forks](https://img.shields.io/github/forks/CJackHwang/ds2api.svg) [![Release](https://img.shields.io/github/v/release/CJackHwang/ds2api?display_name=tag)](https://github.com/CJackHwang/ds2api/releases) [![Docker](https://img.shields.io/badge/docker-ready-blue.svg)](DEPLOY.md) +[![Deploy on Zeabur](https://zeabur.com/button.svg)](https://zeabur.com/templates/L4CFHP) 语言 / Language: [中文](README.MD) | [English](README.en.md) @@ -162,6 +163,12 @@ docker-compose logs -f 更新镜像:`docker-compose up -d --build` +#### Zeabur 一键部署(Dockerfile) + +1. 点击上方 “Deploy on Zeabur” 按钮,一键部署。 +2. 部署完成后访问 `/admin`,使用 Zeabur 环境变量/模板指引中的 `DS2API_ADMIN_KEY` 登录。 +3. 在管理台导入/编辑配置(会写入并持久化到 `/data/config.json`)。 + ### 方式三:Vercel 部署 1. Fork 仓库到自己的 GitHub diff --git a/README.en.md b/README.en.md index 4e872ad..c955ef3 100644 --- a/README.en.md +++ b/README.en.md @@ -5,6 +5,7 @@ ![Forks](https://img.shields.io/github/forks/CJackHwang/ds2api.svg) [![Release](https://img.shields.io/github/v/release/CJackHwang/ds2api?display_name=tag)](https://github.com/CJackHwang/ds2api/releases) [![Docker](https://img.shields.io/badge/docker-ready-blue.svg)](DEPLOY.en.md) +[![Deploy on Zeabur](https://zeabur.com/button.svg)](https://zeabur.com/templates/L4CFHP) Language: [中文](README.MD) | [English](README.en.md) @@ -162,6 +163,12 @@ docker-compose logs -f Rebuild after updates: `docker-compose up -d --build` +#### Zeabur One-Click (Dockerfile) + +1. Click the “Deploy on Zeabur” button above to deploy. +2. After deployment, open `/admin` and login with `DS2API_ADMIN_KEY` shown in Zeabur env/template instructions. +3. Import / edit config in Admin UI (it will be written and persisted to `/data/config.json`). + ### Option 3: Vercel 1. Fork this repo to your GitHub account diff --git a/zeabur.yaml b/zeabur.yaml new file mode 100644 index 0000000..8d36cb4 --- /dev/null +++ b/zeabur.yaml @@ -0,0 +1,60 @@ +# yaml-language-server: $schema=https://schema.zeabur.app/template.json +apiVersion: zeabur.com/v1 +kind: Template +metadata: + name: DS2API +spec: + description: DeepSeek Web 对话转 OpenAI/Claude/Gemini 兼容 API(Go 实现,含 WebUI) + tags: + - DeepSeek + - API + - Go + readme: |- + # DS2API (Zeabur) + + ## After deployment + - Admin panel: `/admin` + - Health check: `/healthz` + - Config is persisted at `/data/config.json` (mounted volume) + + ## First-time setup + 1. Open your service URL, then visit `/admin` + 2. Login with `DS2API_ADMIN_KEY` (shown in Zeabur env/instructions) + 3. Import / edit config in Admin UI (saved to `/data/config.json`) + + services: + - name: ds2api + template: GIT + spec: + source: + source: GITHUB + repo: 1139136822 + branch: main + rootDirectory: / + ports: + - id: web + port: 5001 + type: HTTP + volumes: + - id: data + dir: /data + env: + PORT: + default: "5001" + LOG_LEVEL: + default: "INFO" + DS2API_ADMIN_KEY: + default: ${PASSWORD} + expose: true + DS2API_CONFIG_PATH: + default: /data/config.json + instructions: + - title: Admin panel + content: Visit `/admin` on your service URL. + - title: DS2API admin key + content: ${DS2API_ADMIN_KEY} + healthCheck: + type: HTTP + port: web + http: + path: /healthz