From 67e78e76e37c20845b8a8b9c1c18795e7c190d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E9=A1=BA=E5=BC=BA?= <978987373@qq.com> Date: Fri, 21 Mar 2025 17:34:17 +0800 Subject: [PATCH] update dev script --- frontend/config/paths.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/config/paths.js b/frontend/config/paths.js index 5164270015..bde0897ddf 100644 --- a/frontend/config/paths.js +++ b/frontend/config/paths.js @@ -22,8 +22,10 @@ const resolveApp = relativePath => path.resolve(appDirectory, relativePath); // ); // reset by custom -const HOST = '127.0.0.1'; -const PORT = process.env.PORT || '3000'; +const CONFIG_HOST = process.env.HOST; +const isRunInDocker = CONFIG_HOST === '0.0.0.0'; +const HOST = isRunInDocker ? '127.0.0.1' : CONFIG_HOST; +const PORT = process.env.PORT || '3001'; const publicPath = process.env.PUBLIC_PATH || '/assets/bundles/'; const publicUrlOrPath = `http://${HOST}:${PORT}${publicPath}`;