Add monitored npm install with timeout and fallback registry.
Improve container startup by printing periodic install heartbeat logs, enforcing npm install timeout, and retrying with a fallback registry to avoid silent hangs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -83,6 +83,7 @@ DOCKER_BUILDKIT=1 docker build --network=host \
|
||||
docker run --rm -it \
|
||||
-p 14620:14620 \
|
||||
-p 14621:14621 \
|
||||
-v media_crawler_runtime:/app/runtime \
|
||||
--env-file backend/.env \
|
||||
-e GIT_REPO_URL=https://git.rc707blog.top/rose_cat707/media_crawler.git \
|
||||
-e GIT_BRANCH=main \
|
||||
@@ -95,4 +96,8 @@ docker run --rm -it \
|
||||
- `GIT_BRANCH`:拉取分支(默认 `main`)
|
||||
- `WORKTREE_DIR`:容器内代码目录(默认 `/app/runtime`)
|
||||
- `NPM_REGISTRY`:前端依赖安装镜像源(默认 `https://registry.npmmirror.com`)
|
||||
- `NPM_FALLBACK_REGISTRY`:`NPM_REGISTRY` 失败时回退源(默认 `https://registry.npmjs.org`)
|
||||
- `FORCE_FRONTEND_REBUILD`:强制每次重装前端依赖并重建(默认 `0`,仅 lockfile 变更时才安装构建)
|
||||
- `NPM_INSTALL_TIMEOUT_SEC`:前端依赖安装超时秒数(默认 `900`)
|
||||
- `NPM_PROGRESS_INTERVAL_SEC`:安装过程心跳日志间隔秒数(默认 `15`)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user