dify

代码执行节点安装 python 依赖包,如: requests, pandas

1. 替换 docker-compose.yaml 中的 sandbox 镜像

默认情况下,dify 使用的是官方的 sandbox 镜像,不支持直接扩展库。


   # image: langgenius/dify-sandbox:0.2.12
   image: svcvit/dify-sandbox-py:0.1.4

2. 配置需要的依赖(沙盒挂载卷下的配置文件: E:\dify-1.10.0\docker\volumes\sandbox\dependencies\python-requirements.txt,若没有该文件则创建)


   requests==2.32.3
   pandas==2.2.2

3. 重启容器

4. 运行代码节点提示

error: operation not permitted

4.1. 修改沙盒运行权限(沙盒挂载卷下的配置文件: E:\dify-1.10.0\docker\volumes\sandbox\conf\config.yaml)

开发测试环境可以先全都加上


   allowed_syscalls: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,28,30,31,32,33,34,35,36,37,39,56,57,60,61,62,63,72,73,80,81,85,86,90,91,105,106,131,186,202,204,217,231,233,234,237,257,262,273,281,291,318,334,435,499,318,334,307,262,16,8,217,1,3,257,0,202,9,12,10,11,15,25,105,106,102,39,110,186,60,231,234,13,16,24,273,274,334,228,96,35,291,233,230,270,201,14,131,318,56,258,83,41,42,49,50,43,44,45,51,47,52,54,271,63,46,307,55,5,72,138,7,281]

4.2 重启容器

posted @ 2025-11-22 16:31  凛冬雪夜  阅读(9)  评论(0)    收藏  举报