部署到 dotcloud 的 Webservice/worker 服务
我正在尝试将 node.js 应用程序部署到 dotcloud。
可以在此页面上找到说明:
https://docs.dotcloud.com/#nodejs.html
我发现它很混乱,它没有解释您需要创建的文件的最终结果。
如果我只是做一个简单的网站,我需要“工人”服务吗?
如果我这样做,是否有任何关于如何使用单独的工作人员和“网络”服务对 Node.js 站点进行编程的教程?我不知道...
这是我的supervisor.conf
[program:node]
command = NODE_ENV=production node server.js
directory = /home/dotcloud/current
我的dotcloud.yml:
mynodejswebservice:
type: nodejs
这是正确的吗?需要更换目录吗?
I'm trying to deploy a node.js app to dotcloud.
The instructions are found on this page:
https://docs.dotcloud.com/#nodejs.html
I found it confusing, it doesn't explain the final result of the files that you need to create.
If I'm just doing a simple website, do I need a 'worker' service?
If I do, are there any tutorials for how to program node.js sites with separate workers and 'web' services? I've no idea...
This is my supervisor.conf
[program:node]
command = NODE_ENV=production node server.js
directory = /home/dotcloud/current
My dotcloud.yml:
mynodejswebservice:
type: nodejs
Is this correct? Do we have to replace the directory?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 Dotcloud 上的 NodeJS,Web 服务器只是一种工作服务。
您的supervisord.conf是正确的,您不需要更改目录。虽然我不确定
命令
中的“NODE_ENV=生产”。您可以通过将其添加到supervisord.conf来添加环境变量:
请参阅此处了解更多信息:http:// /supervisord.org/configuration.html?highlight=environment
请参阅此处查看 dotcloud 上的节点supervisord.conf 示例:https://github.com/andzdroid/Batteries/blob/master/www/supervisord .conf
如果你想运行另一个工作服务,你的supervisord.conf看起来是一样的,你只需要更改命令:
For NodeJS on Dotcloud, the web server is just a type of a worker service.
Your supervisord.conf is correct, you don't need to change the directory. Although I'm not sure about the "NODE_ENV=production" inside the
command
.You can add environment variables by adding this to the supervisord.conf:
See here for more info: http://supervisord.org/configuration.html?highlight=environment
See here for an example of a node supervisord.conf on dotcloud: https://github.com/andzdroid/Batteries/blob/master/www/supervisord.conf
If you want to run another worker service, your supervisord.conf will look the same, you just need to change the command: