mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-07 01:45:27 +08:00
Merge pull request #57 from jacob-sheng/feat/zeabur-oneclick
feat(zeabur): 一键部署模板
This commit is contained in:
12
DEPLOY.en.md
12
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:
|
||||
|
||||
[](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
|
||||
|
||||
12
DEPLOY.md
12
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 上一键部署:
|
||||
|
||||
[](https://zeabur.com/templates/L4CFHP)
|
||||
|
||||
部署要点:
|
||||
|
||||
- **端口**:服务默认监听 `5001`,模板会固定设置 `PORT=5001`。
|
||||
- **配置持久化**:模板挂载卷 `/data`,并设置 `DS2API_CONFIG_PATH=/data/config.json`;在管理台导入配置后,会写入并持久化到该路径。
|
||||
- **首次登录**:部署完成后访问 `/admin`,使用 Zeabur 环境变量/模板指引中的 `DS2API_ADMIN_KEY` 登录(建议首次登录后自行更换为强密码)。
|
||||
|
||||
---
|
||||
|
||||
## 三、Vercel 部署
|
||||
|
||||
11
README.MD
11
README.MD
@@ -1,3 +1,7 @@
|
||||
<p align="center">
|
||||
<img src="assets/ds2api-icon.svg" width="128" height="128" alt="DS2API icon" />
|
||||
</p>
|
||||
|
||||
# DS2API
|
||||
|
||||
[](LICENSE)
|
||||
@@ -5,6 +9,7 @@
|
||||

|
||||
[](https://github.com/CJackHwang/ds2api/releases)
|
||||
[](DEPLOY.md)
|
||||
[](https://zeabur.com/templates/L4CFHP)
|
||||
|
||||
语言 / Language: [中文](README.MD) | [English](README.en.md)
|
||||
|
||||
@@ -162,6 +167,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
|
||||
|
||||
11
README.en.md
11
README.en.md
@@ -1,3 +1,7 @@
|
||||
<p align="center">
|
||||
<img src="assets/ds2api-icon.svg" width="128" height="128" alt="DS2API icon" />
|
||||
</p>
|
||||
|
||||
# DS2API
|
||||
|
||||
[](LICENSE)
|
||||
@@ -5,6 +9,7 @@
|
||||

|
||||
[](https://github.com/CJackHwang/ds2api/releases)
|
||||
[](DEPLOY.en.md)
|
||||
[](https://zeabur.com/templates/L4CFHP)
|
||||
|
||||
Language: [中文](README.MD) | [English](README.en.md)
|
||||
|
||||
@@ -162,6 +167,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
|
||||
|
||||
63
assets/ds2api-icon.svg
Normal file
63
assets/ds2api-icon.svg
Normal file
@@ -0,0 +1,63 @@
|
||||
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="DS2API icon">
|
||||
<defs>
|
||||
<linearGradient id="bg" x1="96" y1="96" x2="416" y2="416" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#06162D" />
|
||||
<stop offset="0.6" stop-color="#0A3A6A" />
|
||||
<stop offset="1" stop-color="#00B4D8" />
|
||||
</linearGradient>
|
||||
<radialGradient id="glow" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(256 180) rotate(90) scale(260)">
|
||||
<stop offset="0" stop-color="#FFFFFF" stop-opacity="0.18" />
|
||||
<stop offset="1" stop-color="#FFFFFF" stop-opacity="0" />
|
||||
</radialGradient>
|
||||
<linearGradient id="whale" x1="180" y1="140" x2="360" y2="360" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#EAF7FF" />
|
||||
<stop offset="1" stop-color="#BDEBFF" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
|
||||
<circle cx="256" cy="256" r="240" fill="url(#bg)" />
|
||||
<circle cx="256" cy="256" r="240" fill="url(#glow)" />
|
||||
<circle cx="256" cy="256" r="240" stroke="#FFFFFF" stroke-opacity="0.14" stroke-width="8" />
|
||||
|
||||
<!-- subtle waves -->
|
||||
<path d="M104 338 C156 308 204 366 256 334 C308 302 356 360 408 330" stroke="#FFFFFF" stroke-opacity="0.16" stroke-width="12" stroke-linecap="round" />
|
||||
<path d="M124 372 C174 344 212 396 256 372 C300 348 338 396 388 368" stroke="#FFFFFF" stroke-opacity="0.12" stroke-width="10" stroke-linecap="round" />
|
||||
|
||||
<!-- whale tail (DeepSeek-inspired element, original design) -->
|
||||
<path
|
||||
d="M256 162
|
||||
C228 124 184 118 156 146
|
||||
C132 170 138 206 162 230
|
||||
C190 262 230 252 252 220
|
||||
C254 218 255 216 256 214
|
||||
C257 216 258 218 260 220
|
||||
C282 252 322 262 350 230
|
||||
C374 206 380 170 356 146
|
||||
C328 118 284 124 256 162 Z"
|
||||
fill="url(#whale)"
|
||||
/>
|
||||
<rect x="236" y="214" width="40" height="168" rx="20" fill="url(#whale)" />
|
||||
|
||||
<!-- API nodes -->
|
||||
<g opacity="0.55" stroke="#FFFFFF" stroke-opacity="0.35" stroke-width="6" stroke-linecap="round">
|
||||
<path d="M156 236 L208 206" />
|
||||
<path d="M356 236 L304 206" />
|
||||
<path d="M208 206 L232 172" />
|
||||
<circle cx="156" cy="236" r="10" fill="#FFFFFF" fill-opacity="0.28" />
|
||||
<circle cx="208" cy="206" r="10" fill="#FFFFFF" fill-opacity="0.28" />
|
||||
<circle cx="232" cy="172" r="10" fill="#FFFFFF" fill-opacity="0.28" />
|
||||
<circle cx="304" cy="206" r="10" fill="#FFFFFF" fill-opacity="0.28" />
|
||||
<circle cx="356" cy="236" r="10" fill="#FFFFFF" fill-opacity="0.28" />
|
||||
</g>
|
||||
|
||||
<!-- tiny sparkle -->
|
||||
<path
|
||||
d="M378 164
|
||||
C372 170 366 174 358 176
|
||||
C366 178 372 182 378 188
|
||||
C380 180 384 176 392 176
|
||||
C384 174 380 170 378 164 Z"
|
||||
fill="#FFFFFF"
|
||||
fill-opacity="0.32"
|
||||
/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
60
zeabur.yaml
Normal file
60
zeabur.yaml
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user