dockerup.js
var http = require("http");
var querystring = require('querystring');
var process = require("child_process");
function hello(req, res) {
res.writeHead(200, {"content-type":"text/plain"});
process.exec("sh /fw/shell/dockerup.sh", function(error, stdout, stderr) {
res.writeHead(200, {"content-type":"text/plain"});
res.end(stdout);
})
}
http.createServer(hello).listen(30010, "0.0.0.0");
forever管理
forever start dockerup.js
dockerup.sh
cd /fw/compose/
pwd
docker pull 127.0.0.1:5000/netcore/bar-c-front:latest
docker pull 127.0.0.1:5000/netcore/bar-m-front:latest
docker pull 127.0.0.1:5000/netcore/bar-cash-front:latest
docker pull 127.0.0.1:5000/netcore/bar-webapi-service:latest
docker-compose up -d BarWebAPIService BarMFront BarCashFront BarCFront
echo "success"