Dify (Ubuntu 24.04 Noble x64)部署教程

1.简述

后续补充

2.开始

2.1.下载或者克隆项目内容到本地

https://codeload.github.com/Gideon-Duong/dify/zip/refs/heads/main

bash 复制代码
git clone https://github.com/Gideon-Duong/dify.git

2.2.安装docker环境

bash 复制代码
# 安装依赖
sudo apt update
sudo apt install -y ca-certificates curl gnupg lsb-release

# 添加阿里云的 GPG 密钥
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

# 添加阿里云的 Docker CE 仓库
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# 安装 Docker Engine 和 Compose 插件
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin

2.3.Dify环境下载与挂起

测试DaoCloud源是否可用,决定能不能部署完成:

bash 复制代码
docker pull docker.m.daocloud.io/library/hello-world:latest

下面是一气呵成步骤,如果源挂了就game over了:

bash 复制代码
cd dify
cd docker
cp .env.example .env

# 逐个拉取,避免限流
docker pull docker.m.daocloud.io/library/postgres:15-alpine
docker pull docker.m.daocloud.io/library/redis:6-alpine
docker pull docker.m.daocloud.io/library/nginx:latest
docker pull docker.m.daocloud.io/langgenius/dify-api:1.0.0
docker pull docker.m.daocloud.io/langgenius/dify-web:1.0.0
docker pull docker.m.daocloud.io/langgenius/dify-sandbox:0.2.10
docker pull docker.m.daocloud.io/langgenius/dify-plugin-daemon:0.0.3-local
docker pull docker.m.daocloud.io/semitechnologies/weaviate:1.19.0
docker pull docker.m.daocloud.io/ubuntu/squid:latest

# 将拉取的镜像重命名为原始名称(Docker Compose 需要)
docker tag docker.m.daocloud.io/library/postgres:15-alpine postgres:15-alpine
docker tag docker.m.daocloud.io/library/redis:6-alpine redis:6-alpine
docker tag docker.m.daocloud.io/library/nginx:latest nginx:latest
docker tag docker.m.daocloud.io/langgenius/dify-api:1.0.0 langgenius/dify-api:1.0.0
docker tag docker.m.daocloud.io/langgenius/dify-web:1.0.0 langgenius/dify-web:1.0.0
docker tag docker.m.daocloud.io/langgenius/dify-sandbox:0.2.10 langgenius/dify-sandbox:0.2.10
docker tag docker.m.daocloud.io/langgenius/dify-plugin-daemon:0.0.3-local langgenius/dify-plugin-daemon:0.0.3-local
docker tag docker.m.daocloud.io/semitechnologies/weaviate:1.19.0 semitechnologies/weaviate:1.19.0
docker tag docker.m.daocloud.io/ubuntu/squid:latest ubuntu/squid:latest

docker compose up -d

2.4.这是自用本地文件的安装命令

bash 复制代码
# 解压完dify库之后的一次性操作
cd dify/docker
cp .env.example .env
docker load -i dify-images.tar
docker compose up -d

2.5.改端口重启然后打开UI界面

bash 复制代码
# 如果 EXPOST_NGINX_PORT 已存在,修改其值;否则在文件末尾添加
if grep -q "^EXPOSE_NGINX_PORT=" .env; then
    sed -i 's/^EXPOSE_NGINX_PORT=.*/EXPOSE_NGINX_PORT=8080/' .env
else
    echo "EXPOSE_NGINX_PORT=8080" >> .env
fi

# 重启服务
docker compose down && docker compose up -d

然后访问 http://localhost:8080 即可

64

3.总结

难点:docker国内镜像源很多用不了

相关推荐
张文君19 小时前
上古世纪服务端编译安装AAEmu docker编译安装
运维·docker·容器
蜡笔婧萱19 小时前
Linux--远程登录服务ssh
linux·服务器·ssh
雾岛心情19 小时前
小铭邮件管理工具箱的界面(公司版)
运维·服务器·工具·o365·小铭邮件工具箱(公司版)
一只鹿鹿鹿20 小时前
数据库运维与管理规范(WORD)
运维·数据库
伏加特遇上西柚20 小时前
Loki+Alloy+Grafana日志采集部署
java·linux·服务器·spring boot·grafana·prometheus
King's King20 小时前
自动化立体仓库系统项目施工要点
运维·自动化
资源分享助手20 小时前
三网H5小游戏战车向前冲搭建教程(Win+Linux)
linux·运维·服务器
黑白园20 小时前
Linux i2c驱动初探(一)待补充
linux
无限进步_20 小时前
Linux权限模型:从rwx到粘滞位
linux·运维·服务器
goyeer21 小时前
【ITIL4】- 服务价值体系
大数据·运维·信息化·自动运维·itil