File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ FROM node:18-alpine AS builder
44# 设置工作目录
55WORKDIR /app
66
7- # 复制 package.json 和 lock 文件
7+ # 复制 package.json 和 package- lock.json
88COPY package*.json ./
99
10- # 安装依赖
11- RUN npm ci --only=production
10+ # 安装所有依赖(包括 devDependencies,用于构建)
11+ RUN npm ci
1212
1313# 复制源代码
1414COPY . .
@@ -22,10 +22,14 @@ FROM node:18-alpine
2222# 设置工作目录
2323WORKDIR /app
2424
25- # 复制依赖和构建产物
26- COPY --from=builder /app/node_modules ./node_modules
25+ # 复制 package.json 和 package-lock.json
26+ COPY package*.json ./
27+
28+ # 只安装生产依赖
29+ RUN npm ci --omit=dev
30+
31+ # 复制构建产物
2732COPY --from=builder /app/dist ./dist
28- COPY --from=builder /app/package.json ./
2933
3034# 创建非 root 用户
3135RUN addgroup -g 1001 -S nodejs && \
Original file line number Diff line number Diff line change @@ -369,7 +369,9 @@ pm2 restart watch-room-server
369369
370370## 故障排查
371371
372- ### 连接失败
372+ 遇到问题?查看详细的 [ 故障排查指南] ( TROUBLESHOOTING.md ) 。
373+
374+ 常见问题:
373375
3743761 . 检查防火墙是否开放端口
3753772 . 检查 ALLOWED_ORIGINS 配置
Original file line number Diff line number Diff line change 1414
1515# 安装依赖
1616echo " 📦 安装依赖..."
17- npm ci --only=production
17+ npm install
1818
1919# 构建项目
2020echo " 🔨 构建项目..."
Original file line number Diff line number Diff line change 11{
22 "name" : " watch-room-server" ,
3- "version" : " 1.0.0 " ,
3+ "version" : " 1.0.1 " ,
44 "description" : " Standalone watch room server for MoonTVPlus" ,
55 "main" : " dist/index.js" ,
66 "type" : " module" ,
You can’t perform that action at this time.
0 commit comments