问题描述:
在 Dify 1.0.0 版本发布后,所有 Plugin 都需要联网安装(访问 Marketplace 以及下载 Python 库),如果离线/网络环境不佳则使用可能受影响,此时就需要配置代理。
配置方法:
找到 dify/docker 目录下的 docker-compose.yaml 文件,定位到 plugin_daemon 相关的配置,在 environment 中添加 https_proxy 以及 http_proxy 相关的选项。
配置示例如下:
plugin_daemon:
image: langgenius/dify-plugin-daemon:0.0.3-local
restart: always
environment:
# Use the shared environment variables.
<<: *shared-api-worker-env
DB_DATABASE: ${DB_PLUGIN_DATABASE:-dify_plugin}
SERVER_PORT: ${PLUGIN_DAEMON_PORT:-5002}
SERVER_KEY: ${PLUGIN_DAEMON_KEY:-lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi}
MAX_PLUGIN_PACKAGE_SIZE: ${PLUGIN_MAX_PACKAGE_SIZE:-52428800}
PPROF_ENABLED: ${PLUGIN_PPROF_ENABLED:-false}
DIFY_INNER_API_URL: ${PLUGIN_DIFY_INNER_API_URL:-http://api:5001}
DIFY_INNER_API_KEY: ${INNER_API_KEY_FOR_PLUGIN:-QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1}
PLUGIN_REMOTE_INSTALLING_HOST: ${PLUGIN_REMOTE_INSTALL_HOST:-0.0.0.0}
PLUGIN_REMOTE_INSTALLING_PORT: ${PLUGIN_REMOTE_INSTALL_PORT:-5003}
PLUGIN_WORKING_PATH: ${PLUGIN_WORKING_PATH:-/app/storage/cwd}
FORCE_VERIFYING_SIGNATURE: ${FORCE_VERIFYING_SIGNATURE:-true}
https_proxy: https://username:password@:8443
http_proxy: https://username:password@:8443
ports:
- "${EXPOSE_PLUGIN_DEBUGGING_PORT:-5003}:${PLUGIN_DEBUGGING_PORT:-5003}"
volumes:
- ./volumes/plugin_daemon:/app/storage配置完成后,建议通过 docker compose down plugin_daemon 以及 docker compose up plugin_daemon重启 plugin daemon 服务。
检查
也可以进入到 dify_plugin 容器中,通过 env查看环境变量,确保更改的项目在清单中。
docker exec -it docker-plugin_daemon-1 env
[root@dify docker]# docker exec -it docker-plugin_daemon-1 env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
https_proxy=https://username:password@:8443
http_proxy=https://username:password@:8443
















