官網教程
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。