You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure App Service部署React应用启动超时问题求助

在Azure App Service部署React应用启动超时问题

我在Azure App Service上部署了React应用,package.json文件位于client文件夹。启动应用后出现如下日志,且1800秒后超时:

2024-01-23T09:24:39.837Z INFO  - Starting container for site
2024-01-23T09:24:39.839Z INFO  - docker run -d --expose=80 --name xxxxxxxx_0_947e0bff -e WEBSITE_USE_DIAGNOSTIC_SERVER=true -e PORT=80 -e WEBSITES_PORT=80 -e WEBSITE_SITE_NAME=xxxxxxx-e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=xxxxxxx.azurewebsites.net -e WEBSITE_INSTANCE_ID=xxxxxxxxx-e HTTP_LOGGING_ENABLED=1 -e NODE_OPTIONS=--require /agents/nodejs/build/src/Loader.js appsvc/node:20-lts_20231109.3.tuxprod pm2 serve /home/site/wwwroot/client/build --no-daemon --spa
2024-01-23T09:24:40.321Z INFO  - Initiating warmup request to container xxxxxxxx_0_947e0bff for site xxxxxxx
2024-01-23T09:24:55.419Z INFO  - Waiting for response to warmup request for container xxxxxx_0_947e0bff. Elapsed time = 15.097723 sec

注:所有敏感信息已替换为xxxxxx

已添加以下配置项:

port : 80
websites_port : 80 
WEBSITES_CONTAINER_START_TIME_LIMIT - 1800

启动命令为:

pm2 serve /home/site/wwwroot/client/build --no-daemon --spa

已尝试将端口改为8080和443,但问题依旧。Azure上wwwroot文件夹中的部署文件正常,运行时栈为Linux环境下的Node.js,未使用容器,直接通过代码创建App Service。调整端口、超时时间和启动命令均无效,恳请帮助。

内容的提问来源于stack exchange,提问作者gaurav sharma

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.01 12:22:21