mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-13 20:57:41 +08:00
chore: 删除无用文件,清理 .gitignore Python 残留规则
This commit is contained in:
42
.gitignore
vendored
42
.gitignore
vendored
@@ -2,37 +2,6 @@
|
||||
config.json
|
||||
.env
|
||||
|
||||
# Python
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.so
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
pip-wheel-metadata/
|
||||
share/python-wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
MANIFEST
|
||||
|
||||
# Virtual environments
|
||||
venv/
|
||||
ENV/
|
||||
env/
|
||||
.venv
|
||||
|
||||
# IDE
|
||||
.vscode/
|
||||
.idea/
|
||||
@@ -44,7 +13,6 @@ env/
|
||||
# Logs
|
||||
*.log
|
||||
logs/
|
||||
uvicorn.log
|
||||
artifacts/
|
||||
|
||||
# Vercel
|
||||
@@ -56,8 +24,6 @@ webui/node_modules/
|
||||
webui/dist/
|
||||
.npm
|
||||
.pnpm-store/
|
||||
# 保留 webui/package-lock.json 用于 CI 缓存
|
||||
# package-lock.json # 如果有根目录的可以忽略
|
||||
yarn.lock
|
||||
pnpm-lock.yaml
|
||||
|
||||
@@ -76,14 +42,6 @@ ds2api-tests
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Testing
|
||||
.coverage
|
||||
htmlcov/
|
||||
.pytest_cache/
|
||||
.tox/
|
||||
|
||||
# Misc
|
||||
*.pyc
|
||||
*.pyo
|
||||
.git/
|
||||
Thumbs.db
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
# ========== 阶段1: 构建前端 ==========
|
||||
FROM node:20-slim AS frontend-builder
|
||||
|
||||
WORKDIR /app/webui
|
||||
|
||||
# 复制前端依赖文件
|
||||
COPY webui/package.json webui/package-lock.json ./
|
||||
|
||||
# 安装依赖
|
||||
RUN npm ci
|
||||
|
||||
# 复制前端源码
|
||||
COPY webui/ ./
|
||||
|
||||
# 构建前端
|
||||
RUN npm run build
|
||||
|
||||
# ========== 阶段2: 构建后端 ==========
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 设置环境变量
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV TZ=Asia/Shanghai
|
||||
|
||||
# 安装系统依赖
|
||||
# curl_cffi 需要 libcurl 和编译工具
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
gcc \
|
||||
g++ \
|
||||
libffi-dev \
|
||||
libcurl4-openssl-dev \
|
||||
libssl-dev \
|
||||
curl \
|
||||
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 复制并安装 Python 依赖
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
|
||||
# 复制后端代码
|
||||
COPY app.py .
|
||||
COPY core/ ./core/
|
||||
COPY routes/ ./routes/
|
||||
|
||||
# 创建 templates 目录(预留扩展用)
|
||||
RUN mkdir -p ./templates
|
||||
|
||||
# 复制 WASM 文件和 Tokenizer 相关文件
|
||||
COPY sha3_wasm_bg.7b9ca65ddd.wasm ./
|
||||
COPY tokenizer.json tokenizer_config.json ./
|
||||
|
||||
# 从前端构建阶段复制构建产物到 static/admin
|
||||
COPY --from=frontend-builder /app/webui/dist ./static/admin
|
||||
|
||||
# 创建配置文件目录(运行时挂载)
|
||||
RUN mkdir -p /app/data
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 5001
|
||||
|
||||
# 健康检查
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD curl -f http://localhost:5001/ || exit 1
|
||||
|
||||
# 启动命令
|
||||
CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "5001"]
|
||||
@@ -1,43 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<!-- SEO Meta Tags -->
|
||||
<title>DS2API - DeepSeek API 管理面板</title>
|
||||
<meta name="description" content="DS2API 管理面板 - 轻松管理 DeepSeek 账号、测试 API、同步 Vercel 配置" />
|
||||
<meta name="keywords" content="DeepSeek, API, OpenAI, 管理面板, DS2API" />
|
||||
<meta name="author" content="CJackHwang" />
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
|
||||
<!-- Open Graph / Social -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="DS2API - DeepSeek API 管理面板" />
|
||||
<meta property="og:description" content="轻松管理 DeepSeek 账号、测试 API、同步 Vercel 配置" />
|
||||
<meta property="og:site_name" content="DS2API" />
|
||||
|
||||
<!-- PWA / Mobile -->
|
||||
<meta name="theme-color" content="#f59e0b" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||
<meta name="apple-mobile-web-app-title" content="DS2API" />
|
||||
|
||||
<!-- Favicon - using data URI for orange-yellow gradient icon -->
|
||||
<link rel="icon" type="image/svg+xml"
|
||||
href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23f59e0b'/%3E%3Cstop offset='100%25' stop-color='%23ef4444'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect rx='20' width='100' height='100' fill='url(%23g)'/%3E%3Ctext x='50' y='68' font-family='Arial,sans-serif' font-size='48' font-weight='bold' fill='white' text-anchor='middle'%3EDS%3C/text%3E%3C/svg%3E" />
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet">
|
||||
<script type="module" crossorigin src="/admin/assets/index-Da8PBvaf.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/admin/assets/index-BzdNSWuo.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user