Docker部署AI相关工具

部署Dify

系统要求

  • CPU >= 2 Core
  • RAM >= 4 GiB

下载最新的源码包:https://github.com/langgenius/dify/releases

解压并进入docker目录

1
2
3
4
5
6
7
8
9
# 拉取镜像
docker compose -f docker-compose.yaml pull
# 设置环境变量
cp .env.example .env
#设置插件PIP镜像
vim .env
PIP_MIRROR_URL=https://mirrors.aliyun.com/pypi/simple/
# 启动容器
docker compose up -d

部署Xinference

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 下载镜像
docker pull xprobe/xinference:latest

# 运行
docker run -d \
--name=xinference \
--restart=unless-stopped \
-e XINFERENCE_MODEL_SRC=modelscope \
-e XINFERENCE_HOME=/models \
-p 9997:9997 \
-v $PWD:/models\
--gpus all \
xprobe/xinference:latest \
xinference-local -H 0.0.0.0 --log-level debug

环境变量说明

1
2
3
XINFERENCE_ENDPOINT # Xinference 的服务地址,用来与 Xinference 连接。默认地址是 http://127.0.0.1:9997,可以在日志中获得这个地址。
XINFERENCE_MODEL_SRC=modelscope # 使用modelscope作为模型仓库,默认下载源是huggingface
XINFERENCE_HOME=/models # Xinference 默认使用 <HOME>/.xinference 作为默认目录来存储模型以及日志等必要的文件

Docker部署AI相关工具
https://www.intx.work/posts/7f1c3c75.html
发布于
2025年4月25日
更新于
2025年6月29日
许可协议