写在前面
安装Dify前,请先安装docker。
git 安装项目
在服务上安装git
之后,通过git
进行安装,首先进入到local
目录,
cd /usr/local
然后执行下面的指令
sudo git clone https://github.com/langgenius/dify.git
运行dify项目
首次运行的时候切换到dify
项目的文件目录,我的dify
安装目录usr/local
找到dify
目录,继续找到docker
目录,然后执行,配置环境
cp .env.example .env
docker compose up -d
很不幸,出现异常,但是不要慌哈,接着往下看。
尝试使用国内镜像源
sudo mkdir -p /etc/docker
echo '{
"registry-mirrors": [
"https://docker.zhai.cm",
"https://a.ussh.net",
"https://hub.littlediary.cn",
"https://hub.rat.dev",
"https://atomhub.openatom.cn",
"https://docker.m.daocloud.io",
"https://docker.1ms.run",
"https://dytt.online",
"https://func.ink",
"https://lispy.org",
"https://docker.xiaogenban1993.com",
"https://docker.mybacc.com",
"https://docker.yomansunter.com",
"https://dockerhub.websoft9.com"
]
}' | sudo tee /etc/docker/daemon.json
执行脚本之后,然后重启 Docker。
sudo systemctl restart docker
在重新执行sduo docker compose up -d
正常下载相关文件啦
至此等待安装完成就可以啦,最后检查容器是否运行。
docker ps
找到ip和端口号,最后你输入http://你的公网ip:80/install
,最终效果如下: