搭建Dify

Dify平台简介与核心价值

Dify是一款开源的大语言模型(LLM)应用开发平台,通过可视化界面实现AI工作流编排、RAG引擎搭建及多模型集成。其核心优势在于将复杂的AI开发流程简化为零代码操作,支持从原型设计到生产部署的全生命周期管理。用户可选择云端SaaS服务或私有化部署方案,前者适合快速验证创意,后者则满足企业级数据安全与定制化需求。(官网提供了两种部署方案,我选择注册方式二)

私有化部署专业方案

技术团队建议通过Docker部署本地版本,需确保服务器满足最低配置(CPU≥2核,RAM≥4GB):

bash 复制代码
git clone https://github.com/langgenius/dify.git
cd dify/docker
cp .env.example .env

安装docker desktop

www.docker.com/ 下面对应的系统版本

dify\docker路径下新建文件daemon.json

daemon.json 文件内容

json 复制代码
{
    "registry-mirrors": [
        "https://docker.1ms.run",
        "https://hub.rat.dev",
        "https://docker.1panel.live",
        "https://hub.rat.dev",
        "https://proxy.1panel.live",
        "https://ghcr.nju.edu.cn",
        "https://docker.registry.cyou",
        "https://dockercf.jsdelivr.fyi",
        "https://docker.rainbond.cc",
        "https://registry.cn-shenzhen.aliyuncs.com",
        "https://dockertest.jsdelivr.fyi",
        "https://mirror.aliyuncs.com",
        "https://mirror.baidubce.com",
        "https://docker.mirrors.ustc.edu.cn",
        "https://docker.mirrors.sjtug.sjtu.edu.cn",
        "https://mirror.iscas.ac.cn",
        "https://docker.nju.edu.cn",
        "https://docker.m.daocloud.io",
        "https://dockerproxy.com",
        "https://docker.jsdelivr.fyi",
        "https://docker-cf.registry.cyou"
    ],
    "insecure-registries": [],
    "debug": true,
    "experimental": false
}

docker desktop 配置

按照下图操作

复制下方json代码,点击apply

json 复制代码
{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "registry-mirrors": [
    "https://docker.1ms.run",
    "https://hub.rat.dev",
    "https://docker.1panel.live",
    "https://hub.rat.dev",
    "https://proxy.1panel.live",
    "https://ghcr.nju.edu.cn",
    "https://docker.registry.cyou",
    "https://dockercf.jsdelivr.fyi",
    "https://docker.rainbond.cc",
    "https://registry.cn-shenzhen.aliyuncs.com",
    "https://dockertest.jsdelivr.fyi",
    "https://mirror.aliyuncs.com",
    "https://mirror.baidubce.com",
    "https://docker.mirrors.ustc.edu.cn",
    "https://docker.mirrors.sjtug.sjtu.edu.cn",
    "https://mirror.iscas.ac.cn",
    "https://docker.nju.edu.cn",
    "https://docker.m.daocloud.io",
    "https://dockerproxy.com",
    "https://docker.jsdelivr.fyi",
    "https://docker-cf.registry.cyou"
  ]
}

dify\docker路径下打开命令窗口

css 复制代码
docker compose up -d 或者 docker compose -p dify-project up -d

执行完成后等待running完成即可。

注:需要在服务中启动docker服务

结语

部署完成后访问http://localhost/install初始化管理员账号,设置密码复杂度需包含大小写字母及特殊符号。首次登录需配置网络端口与SSL证书,建议使用Nginx反向代理强化安全防护。(默认80端口,需要考虑是否被占用,也可以在docker-compose.yaml中修改端口号)

相关推荐
怕浪猫12 小时前
DeepSeek Harness 源码实战第2章:Cordis——驱动 dsh 的插件引擎
aigc·openai·agent
做前端的娜娜子1 天前
文本切片与召回(Chunk、Overlap 到混合检索)学习笔记
langchain·openai·掘金·金石计划
码农进化录1 天前
Java 程序员的 AI 进化论 | Spring Boot 搭企业智能客服,从设计到上线
java·spring boot·openai
全栈弄潮儿1 天前
4 个新手就能直接套用的 AI 编程提示词模板
chatgpt·openai·ai编程
全栈弄潮儿2 天前
如何向 AI 清楚描述一个编程需求
chatgpt·openai·ai编程
整点bug2 天前
AI 运维该不该自动执行命令?
运维·ssh·openai
卡卡罗特AI2 天前
AI总乱改代码?一个规则文件帮你搞定!99%的人都没设置!附万能模板!
openai·ai编程
ZzT3 天前
把 AI Coding 工作流做成插件:资产、契约与运行时的三层拆分
aigc·openai·ai编程
全栈弄潮儿3 天前
一周总结:AI 编程入门最重要的 3 个原则
chatgpt·openai·ai编程
全栈弄潮儿4 天前
新手最常见的 5 个 AI 编程误区:避免“复制粘贴就上线”
chatgpt·openai·ai编程