hel*_*y77 15 node.js forever docker
我有一个问题,当启动节点永远在docker容器中,如果我手动启动工作,而不是相同的命令在Dockerfile中,当构建并启动容器时,退出.该命令在bash中有效:
docker run -it container_name bash forever start -c 'node --harmony' /my/path/app.js
Run Code Online (Sandbox Code Playgroud)
我试图将命令放在Dockerfile中,但容器没有启动
CMD forever start -c 'node --harmony' /my/path/app.js
Run Code Online (Sandbox Code Playgroud)
Eri*_*cis 30
Forever start script.js
在后台运行.要forever
在前台运行,请尝试forever script.js
.
这开始于前景,这是Docker所需要的.只要CMD中定义的进程启动并运行,请记住容器是"活着的".由于永远作为守护进程启动,命令本身退出并且docker也将退出.
CMD forever -c 'node --harmony' /my/path/app.js
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
9731 次 |
最近记录: |