65 lines
1.3 KiB
Markdown
65 lines
1.3 KiB
Markdown
# Dify 一键部署脚本(简化版)
|
||
|
||
由于完整版 Dify 依赖较多服务,提供一个简化版本
|
||
|
||
## 使用说明
|
||
|
||
### 方式1:使用官方一键部署(推荐)
|
||
|
||
```bash
|
||
# Linux/Mac
|
||
curl -L https://dify.ai/install.sh | bash
|
||
|
||
# Windows (使用 PowerShell)
|
||
irm https://dify.ai/install.ps1 | iex
|
||
```
|
||
|
||
### 方式2:手动部署简化版
|
||
|
||
创建一个简化版的 docker-compose.yml:
|
||
|
||
```yaml
|
||
version: '3'
|
||
services:
|
||
api:
|
||
image: langgenius/dify-api:latest
|
||
ports:
|
||
- "8081:8081"
|
||
environment:
|
||
- SECRET_KEY=dify-secret-key
|
||
- DB_USERNAME=postgres
|
||
- DB_PASSWORD=dify123
|
||
- DB_HOST=10.0.0.1 # 远程 PostgreSQL
|
||
- REDIS_HOST=10.0.0.2 # 远程 Redis
|
||
|
||
web:
|
||
image: langgenius/dify-web:latest
|
||
ports:
|
||
- "8080:3000"
|
||
```
|
||
|
||
### 方式3:使用在线 Dify 服务
|
||
|
||
生产环境已有 Dify 服务(内网可访问):
|
||
- 地址:http://yw-dify.dc.servyou-it.com/
|
||
|
||
---
|
||
|
||
## 本地开发建议
|
||
|
||
由于本地部署 AI 服务资源需求大,建议:
|
||
|
||
1. **开发测试时**:使用 Mock 数据(已实现)
|
||
2. **集成测试时**:连接生产 Dify(需内网)
|
||
3. **完整部署时**:在服务器上部署
|
||
|
||
---
|
||
|
||
## 快速验证 Dify API
|
||
|
||
```powershell
|
||
# 测试生产 Dify
|
||
curl -X GET 'http://yw-dify.dc.servyou-it.com/console/api/workspaces' \
|
||
-H 'Authorization: Bearer YOUR-API-KEY'
|
||
```
|