0
CRT + C
在使用docker運行應用程序時未停止節點應用程序。以下是我所做的步驟。我會非常感謝你的幫助。使用docker時無法退出節點應用程序
我的節點應用程序。
var config = require('./config.json');
var mongodb = require('mongodb');
var request = require('request');
var http = require('http');
// Debug log entry when starting the daemon.
console.log("REST daemon started successfully.\n");
console.log("The daemon interval is : "+ config.queue_interval +".\n");
// Resetting failed REST calls if there are any.
if (config.reset_when_start) resetCallbacks();
// Calling processQueue with the given interval.
setInterval(setSubDaemon, config.queue_interval);
setSubDaemon();
function setSubDaemon() {
// my code is here.
}
而且我的docker命令用於運行nodeapp如下。
docker run --link mongo:mongo -v /home/eranga/workspace/clms/daemon:/opt -p 127.0.0.1:8087:8080 custom-node-image
謝謝回覆。這是行不通的。 –
這使容器在後臺運行 –