Files
MemRelay/projects/d44c219a-0b31-4de1-b160-323eb34a4c6a/Docker开发镜像Nest热重载需安装procps.md
T

21 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: Docker开发镜像Nest热重载需安装procps
type: experience
permalink: main/projects/d44c219a-0b31-4de1-b160-323eb34a4c6a/docker-开发镜像-nest-热重载需安装-procps
stable_id: da7a2613-9076-4924-b49e-07a41ffaf126
scope: project
project_id: d44c219a-0b31-4de1-b160-323eb34a4c6a
memory_type: experience
status: active
revision: 1
restored_from_commit: 6a6a895eafcca6052e81a14fca103a42635dd1c2
created_at: '2026-09-23T15:06:48.406885+00:00'
updated_at: '2026-09-23T15:06:48.406944+00:00'
tags:
- docker
- development
- hot-reload
- verified
---
Windows Docker Desktop 本地开发实测:Vite 使用轮询挂载源码后可以热更新;Nest watch 能检测源码并编译,但 node:24-slim 不自带 ps,Nest CLI 的 treeKillSync 内部 spawnSync('ps',['-A','-o','pid,ppid']) 失败后只杀父进程,遗留旧API进程占用3000,导致EADDRINUSE且仍响应旧代码。修复为仅在Dockerfile.dev安装procps,保留Nest已有watch流程,不引入额外监听依赖。修复后已验证后端临时响应字段加入与撤销都自动生效,容器ID和启动时间不变。前端也通过无需刷新页面的DOM标记验证HMR。临时验证标记已恢复,不进入提交。