diff --git a/docker/docker-compose-template.yaml b/docker/docker-compose-template.yaml index 3c88cddf8c..256f48125d 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 c03cb2ef9f..1410c0d40d 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -821,7 +821,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 f24e9f2fc3..d3c608936f 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -49,24 +49,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 7f5740a471..f81dfe36ff 100644 --- a/web/README.md +++ b/web/README.md @@ -79,8 +79,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 7e1aca680b..034ed96491 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 85e5171203..0000000000 --- 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 - } - ] -}