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.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
use pm2 to guard and monitor the web service in docker file (#2238)
Bowen Liang965ca36525a9
diff --git a/web/Dockerfile b/web/Dockerfileindex 7c3117bcbac..18cd3331ed4 100644--- a/web/Dockerfile+++ b/web/Dockerfile@@ -40,12 +40,17 @@ ENV TZ UTCRUN ln -s /usr/share/zoneinfo/${TZ} /etc/localtime \&& echo ${TZ} > /etc/timezone+# global runtime packages+RUN yarn global add pm2 \+ && yarn cache clean+WORKDIR /app/webCOPY --from=builder /app/web/public ./publicCOPY --from=builder /app/web/.next/standalone ./COPY --from=builder /app/web/.next/static ./.next/static+COPY docker/pm2.json ./pm2.jsonCOPY docker/entrypoint.sh ./entrypoint.shARG COMMIT_SHAdiff --git a/web/docker/entrypoint.sh b/web/docker/entrypoint.shindex 393b03fdb2f..4f8a977cf63 100755--- a/web/docker/entrypoint.sh+++ b/web/docker/entrypoint.sh@@ -10,4 +10,4 @@ export NEXT_PUBLIC_PUBLIC_API_PREFIX=${APP_API_URL}/apiexport NEXT_PUBLIC_SENTRY_DSN=${SENTRY_DSN}export NEXT_PUBLIC_SITE_ABOUT=${SITE_ABOUT}-node ./server.js+pm2 start ./pm2.json --no-daemondiff --git a/web/docker/pm2.json b/web/docker/pm2.jsonindex 7929a8315d1..85e51712036 100644--- a/web/docker/pm2.json+++ b/web/docker/pm2.json@@ -1,12 +1,11 @@{- "apps": [- {- "name": "WebApp",- "exec_mode": "cluster",- "instances": 1,- "script": "./node_modules/next/dist/bin/next",- "cwd": "/app/web",- "args": "start"- }- ]- }+ "apps": [+ {+ "name": "dify-web",+ "script": "/app/web/server.js",+ "cwd": "/app/web",+ "exec_mode": "cluster",+ "instances": 2+ }+ ]+}