From 01172d429e23aa9a2ce4eec7db6161fd30946970 Mon Sep 17 00:00:00 2001 From: Architecture Designer Date: Tue, 10 Mar 2026 08:46:35 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9E=B6=E6=9E=84:=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=E6=8C=87=E5=8D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- architecture/deployment.md | 75 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 architecture/deployment.md diff --git a/architecture/deployment.md b/architecture/deployment.md new file mode 100644 index 0000000..3e54001 --- /dev/null +++ b/architecture/deployment.md @@ -0,0 +1,75 @@ +# 部署指南 + +## 环境要求 + +### 后端 +- Node.js 18+ +- SQLite3 +- 2GB+ RAM + +### 前端 +- Electron 28+ +- 4GB+ RAM + +## 部署步骤 + +### 1. 后端部署 + +```bash +# 克隆代码 +git clone +cd clouddisk-project/backend + +# 安装依赖 +npm install + +# 配置环境变量 +cp .env.example .env +# 编辑 .env 文件 + +# 启动服务 +npm start + +# 使用 PM2 守护进程 +pm2 start src/index.js --name clouddisk-backend +``` + +### 2. 前端构建 + +```bash +cd clouddisk-project/frontend + +# 安装依赖 +npm install + +# 开发模式 +npm run dev + +# 生产构建 +npm run build +``` + +### 3. 反向代理 (Nginx) + +```nginx +server { + listen 80; + server_name api.yourdomain.com; + + location / { + proxy_pass http://localhost:3000; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + } +} +``` + +## 监控 + +- PM2: `pm2 monit` +- 日志: `pm2 logs` + +## 备份 + +- 定期备份 SQLite 数据库文件 +- 备份上传目录