stnh70 commited on
Commit
8bfe0bc
·
verified ·
1 Parent(s): eeb6129

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -3
Dockerfile CHANGED
@@ -15,8 +15,8 @@ RUN npm install n8n -g
15
  # 创建启动脚本目录
16
  RUN mkdir -p /app
17
 
18
- # 创建带心跳监控的启动脚本
19
- RUN cat > /app/start-with-heartbeat.js << 'EOF'
20
  const { spawn } = require('child_process');
21
 
22
  // Periodic heartbeat to confirm event loop activity (can be removed later)
@@ -37,7 +37,7 @@ const n8nProcess = spawn('n8n', ['start'], {
37
 
38
  // 处理进程退出
39
  n8nProcess.on('exit', (code, signal) => {
40
- console.log(`[diagnostic] n8n process exited with code ${code}, signal ${signal}`);
41
  process.exit(code);
42
  });
43
 
@@ -53,5 +53,6 @@ process.on('SIGINT', () => {
53
  });
54
  EOF
55
 
 
56
  # 使用带心跳监控的启动脚本
57
  CMD ["node", "/app/start-with-heartbeat.js"]
 
15
  # 创建启动脚本目录
16
  RUN mkdir -p /app
17
 
18
+ # 创建启动脚本
19
+ COPY <<EOF /app/start-with-heartbeat.js
20
  const { spawn } = require('child_process');
21
 
22
  // Periodic heartbeat to confirm event loop activity (can be removed later)
 
37
 
38
  // 处理进程退出
39
  n8nProcess.on('exit', (code, signal) => {
40
+ console.log(\`[diagnostic] n8n process exited with code \${code}, signal \${signal}\`);
41
  process.exit(code);
42
  });
43
 
 
53
  });
54
  EOF
55
 
56
+
57
  # 使用带心跳监控的启动脚本
58
  CMD ["node", "/app/start-with-heartbeat.js"]