Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

chore(web): remove PM2 process manager (#30252)

liffb538b005c3d
diff --git a/docker/docker-compose-template.yaml b/docker/docker-compose-template.yaml
index 18a12114daf..fcd4800143e 100644
--- a/docker/docker-compose-template.yaml
+++ b/docker/docker-compose-template.yaml
@@ -149,7 +149,6 @@ services:
MARKETPLACE_URL: ${MARKETPLACE_URL:-https://marketplace.dify.ai}
TOP_K_MAX_VALUE: ${TOP_K_MAX_VALUE:-}
INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH: ${INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH:-}
- PM2_INSTANCES: ${PM2_INSTANCES:-2}
LOOP_NODE_MAX_COUNT: ${LOOP_NODE_MAX_COUNT:-100}
MAX_TOOLS_NUM: ${MAX_TOOLS_NUM:-10}
MAX_PARALLEL_LIMIT: ${MAX_PARALLEL_LIMIT:-10}
diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml
index 003ecf84975..62421d7ec47 100644
--- a/docker/docker-compose.yaml
+++ b/docker/docker-compose.yaml
@@ -844,7 +844,6 @@ services:
MARKETPLACE_URL: ${MARKETPLACE_URL:-https://marketplace.dify.ai}
TOP_K_MAX_VALUE: ${TOP_K_MAX_VALUE:-}
INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH: ${INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH:-}
- PM2_INSTANCES: ${PM2_INSTANCES:-2}
LOOP_NODE_MAX_COUNT: ${LOOP_NODE_MAX_COUNT:-100}
MAX_TOOLS_NUM: ${MAX_TOOLS_NUM:-10}
MAX_PARALLEL_LIMIT: ${MAX_PARALLEL_LIMIT:-10}
diff --git a/web/Dockerfile b/web/Dockerfile
index d71b1b6ba61..fe4ea1a579d 100644
--- a/web/Dockerfile
+++ b/web/Dockerfile
@@ -50,24 +50,18 @@ ENV MARKETPLACE_API_URL=https://marketplace.dify.ai
ENV MARKETPLACE_URL=https://marketplace.dify.ai
ENV PORT=3000
ENV NEXT_TELEMETRY_DISABLED=1
-ENV PM2_INSTANCES=2
# set timezone
ENV TZ=UTC
RUN ln -s /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo ${TZ} > /etc/timezone
-# global runtime packages
-RUN pnpm add -g pm2
-
-
# Create non-root user
ARG dify_uid=1001
RUN addgroup -S -g ${dify_uid} dify && \
adduser -S -u ${dify_uid} -G dify -s /bin/ash -h /home/dify dify && \
mkdir /app && \
- mkdir /.pm2 && \
- chown -R dify:dify /app /.pm2
+ chown -R dify:dify /app
WORKDIR /app/web
diff --git a/web/README.md b/web/README.md
index f069ec82b2a..1e57e7c6a97 100644
--- a/web/README.md
+++ b/web/README.md
@@ -89,8 +89,6 @@ If you want to customize the host and port:
pnpm run start --port=3001 --host=0.0.0.0
```
-If you want to customize the number of instances launched by PM2, you can configure `PM2_INSTANCES` in `docker-compose.yaml` or `Dockerfile`.
-
## Storybook
This project uses [Storybook](https://storybook.js.org/) for UI component development.
diff --git a/web/docker/entrypoint.sh b/web/docker/entrypoint.sh
index 7e1aca680ba..034ed964915 100755
--- a/web/docker/entrypoint.sh
+++ b/web/docker/entrypoint.sh
@@ -43,4 +43,4 @@ export NEXT_PUBLIC_MAX_PARALLEL_LIMIT=${MAX_PARALLEL_LIMIT}
export NEXT_PUBLIC_MAX_ITERATIONS_NUM=${MAX_ITERATIONS_NUM}
export NEXT_PUBLIC_MAX_TREE_DEPTH=${MAX_TREE_DEPTH}
-pm2 start /app/web/server.js --name dify-web --cwd /app/web -i ${PM2_INSTANCES} --no-daemon
+exec node /app/web/server.js
diff --git a/web/docker/pm2.json b/web/docker/pm2.json
deleted file mode 100644
index 85e51712036..00000000000
--- a/web/docker/pm2.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "apps": [
- {
- "name": "dify-web",
- "script": "/app/web/server.js",
- "cwd": "/app/web",
- "exec_mode": "cluster",
- "instances": 2
- }
- ]
-}