官网教程
https://github.com/langgenius/dify/blob/main/README_CN.md
1、下载源码
git clone https://github.com/langgenius/dify.git
2、进入docker目录
cd dify
cd docker
cp .env.example .env
修改nginx对外端口配置
修改为9000
最后执行:docker compose up -d
最后访问地址 xxxxx:9000/install
备注:安装可能报错
报错
Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
使用镜像加速器(如果在中国)
如果你在中国使用 Docker,访问 Docker Hub 可能会比较慢。可以配置 Docker 使用国内的镜像加速器。
编辑 Docker 配置文件 /etc/docker/daemon.json(如果不存在该文件,可以创建它):
{
"registry-mirrors": [
"https://docker.nju.edu.cn",
"https://hub.littlediary.cn",
"https://hub.xdark.top",
"https://dockerpull.org",
"https://hub.crdz.gq",
"https://docker.1panel.live",
"https://docker.unsee.tech"
]
}
然后重启 Docker 服务:
sudo systemctl daemon-reload
sudo systemctl restart docker
重新运行 docker compose up -d。