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国内镜像源很多用不了

相关推荐
pt10432 分钟前
思科网络自动化入门课程介绍
运维·网络·自动化
AI创界者4 分钟前
打造内网安全防线:使用 Kali Linux 进行企业级漏洞风险自查与防御指南
linux·运维·安全
weixin_4398575415 分钟前
在Ubuntu 26.04版本上借助本地AI助手在AMD显卡基础上安装并运行Qwen3.6-35B-A3B,作为本地编程AI
linux·人工智能·ubuntu
数字新视界21 分钟前
档案库房环境安全监控解决方案
大数据·运维·数据库·物联网·环境监控系统
大耳朵-小飞象9 小时前
智能调光4巨头争霸!轨道照明如何破局?
运维·智慧城市·智慧路灯·智能照明·楼宇智控·0-10v调光模块
sanzk9 小时前
firefly开发板ubuntu安装ros2下的micro-ROS Agent
linux·运维·ubuntu
努力进修10 小时前
Docker+cpolar 实战:打造灵活可控的远程办公系统
运维·docker·容器
其实防守也摸鱼11 小时前
运维--怎么看接口的请求和返回
运维·学习·网络安全·网络攻击模型·burpsuite·攻防对抗·蓝队
weixin_3077791312 小时前
Linux下Nginx故障系统化检查Shell脚本
linux·运维·服务器·nginx·自动化
skyutuzz13 小时前
node安装部署
linux