这是个人记录用的,因此比较简略,仅供参考
- 下载dify
- 参考
https://docs.dify.ai/zh-hans/getting-started/install-self-hosted/docker-compose
通过docker去运行 - 注意,运行
docke compose up -d
的时候,需要改用docker镜像地址,否则连接外网是无法访问的(类似npm)按照下方截图的步骤操作即可
- 参考
其中仓库mirror为:
json
"registry-mirrors": [
"https://docker.1panel.live",
"https://docker.nju.edu.cn",
"https://docker.m.daocloud.io",
"https://dockerproxy.com",
"https://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn",
"https://registry.docker-cn.com",
"https://registry.cn-hangzhou.aliyuncs.com",
"https://xxxxx.mirror.aliyuncs.com"
]
- 运行后,访问
http://localhost/install
,设置管理员密码并登录 3. 本地启动ollama,具体安装步骤见网络教程 *ollala run <model>
* 运行后访问http://127.0.0.1:11434/ 查看是否运行成功

- 在dify中设置ollama运行的模型,这里以文生图为例 进入模型设置页面,选择ollama

最重要的是这里,模型的url,不能是127.0.0.1:11434,因为Dify
是通过docker运行的,无法访问
需要通过http://host.docker.internal:11434
才能用

最后,在右上角选中输入的ollama模型,即可正常运行
