dify1.14.2 安装部署
环境:
Os:Centos 7
dify:1.14.2
1.拉取v1.14.2代码包
[root@localhost opt]#cd /opt
[root@localhost opt]#git clone --branch 1.14.2 https://github.com/langgenius/dify.git
[root@localhost opt]#cd dify/docker
或者直接下载指定版本,我这里是使用如下方式下载的
[root@localhost opt]#cd /opt
[root@localhost opt]#wget https://github.com/langgenius/dify/archive/refs/tags/1.14.2.zip
2.解压
[root@localhost opt]#cd /opt
[root@localhost opt]#unzip dify-1.14.2.zip
3.修改配置
##使用模版文件创建环境变量文件,该文件定义了使用那些组件,比如关系型数据库使用的是pg,向量数据库使用的是weaviate
[root@localhost opt]#cd /opt/dify-1.14.2/docker
[root@localhost opt]#cp .env.example .env
查看文件内容,除了dify自身组件(dify-api,dify-web)外,还使用到如下的插件
# Database
DB_TYPE=postgresql
# Redis and Celery
REDIS_HOST=redis
# Storage and default vector store
STORAGE_TYPE=opendal
OPENDAL_SCHEME=fs
OPENDAL_FS_ROOT=storage
VECTOR_STORE=weaviate
VECTOR_INDEX_NAME_PREFIX=Vector_index
WEAVIATE_ENDPOINT=http://weaviate:8080
# Sandbox and SSRF proxy
CODE_EXECUTION_ENDPOINT=http://sandbox:8194
CODE_EXECUTION_API_KEY=dify-sandbox
CODE_EXECUTION_SSL_VERIFY=True
CODE_EXECUTION_POOL_MAX_CONNECTIONS=100
CODE_EXECUTION_POOL_MAX_KEEPALIVE_CONNECTIONS=20
CODE_EXECUTION_POOL_KEEPALIVE_EXPIRY=5.0
CODE_EXECUTION_CONNECT_TIMEOUT=10
CODE_EXECUTION_READ_TIMEOUT=60
CODE_EXECUTION_WRITE_TIMEOUT=10
SANDBOX_API_KEY=dify-sandbox
SANDBOX_GIN_MODE=release
SANDBOX_WORKER_TIMEOUT=15
SANDBOX_ENABLE_NETWORK=true
SANDBOX_HTTP_PROXY=http://ssrf_proxy:3128
SANDBOX_HTTPS_PROXY=http://ssrf_proxy:3128
# Plugin daemon
DB_PLUGIN_DATABASE=dify_plugin
EXPOSE_PLUGIN_DAEMON_PORT=5002
# Nginx and Docker Compose
NGINX_SERVER_NAME=_
NGINX_HTTPS_ENABLED=false
4.获取docker-compose.yaml定义的镜像
image: busybox:latest
image: langgenius/dify-api:1.14.2
image: langgenius/dify-web:1.14.2
image: postgres:15-alpine 改成 postgres:15.17-alpine 这里也可以使用amd架构下的镜像的比如:postgres:15.18
image: redis:6-alpine 改成 redis:6.2.22-alpine 这里也可以使用amd架构下的镜像的比如:redis:6.2.22
image: langgenius/dify-sandbox:0.2.15
image: langgenius/dify-plugin-daemon:0.6.1-local
image: ubuntu/squid:latest
image: nginx:latest
image: semitechnologies/weaviate:1.27.0
下载以上这些插件
docker pull busybox:latest
docker pull langgenius/dify-api:1.14.2
docker pull langgenius/dify-web:1.14.2
docker pull postgres:15-alpine ##改成postgres:15.17-alpine 这里有个大坑 不能这样写 写具体的版本号
docker pull redis:6-alpine ##改成 redis:6.2.22-alpine
docker pull langgenius/dify-sandbox:0.2.15
docker pull langgenius/dify-plugin-daemon:0.6.1-local
docker pull ubuntu/squid:latest
docker pull nginx:latest
docker pull semitechnologies/weaviate:1.27.0
查看下载的镜像
[root@localhost docker]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx latest 4e5db4761e0f 7 days ago 161MB
postgres 15-alpine 9b4593c6de44 2 weeks ago 292MB ##这个镜像会经常性改变,使用命令查看2个不同时段下载的镜像是否是一个docker inspect postgres:15-alpine | grep -E "Id|Created|Uid|Gid"
langgenius/dify-api 1.14.2 c688cbe52293 2 months ago 2.99GB
langgenius/dify-web 1.14.2 81bebc66946d 2 months ago 542MB
langgenius/dify-plugin-daemon 0.6.1-local 3fae07effbd9 2 months ago 1.61GB
redis 6-alpine 1f0f16ceecd1 2 months ago 27.9MB
langgenius/dify-sandbox 0.2.15 4782db7ea946 2 months ago 585MB
ubuntu/squid latest f49c57d20819 8 months ago 205MB
semitechnologies/weaviate 1.27.0 f24b5f0e68e6 21 months ago 161MB
busybox latest c6348fa86ba0 2 months ago 4.45MB
5.部署
[root@localhost docker]#cd /opt/dify-1.14.2/docker
[root@localhost docker]#docker compose up -d
6.界面访问
http://192.168.1.136
设置管理员账号


解决目录权限问题
[root@localhost docker]# docker compose logs -f api_websocket
api_websocket-1 | Running migrations
api_websocket-1 | Preparing database migration...
api_websocket-1 | Database migration skipped
api_websocket-1 | [2026-07-23 06:33:35 +0000] [1] [INFO] Starting gunicorn 26.0.0
api_websocket-1 | [2026-07-23 06:33:35 +0000] [1] [INFO] Listening at: http://0.0.0.0:5001 (1)
api_websocket-1 | [2026-07-23 06:33:35 +0000] [1] [INFO] Using worker: geventwebsocket.gunicorn.workers.GeventWebSocketWorker
api_websocket-1 | [2026-07-23 06:33:35 +0000] [21] [INFO] Booting worker with pid: 21
api_websocket-1 | [2026-07-23 06:33:36 +0000] [1] [ERROR] Control server error: [Errno 13] Permission denied: '/home/dify'
api_websocket-1 | gRPC patched with gevent.
api_websocket-1 | psycopg2 patched with gevent.
解决办法:
https://www.cnblogs.com/hxlasky/p/21001015
浙公网安备 33010602011771号