部署到 dotcloud 的 Webservice/worker 服务

发布于 2024-11-16 20:11:06 字数 581 浏览 9 评论 0原文

我正在尝试将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

2024-11-23 20:11:06

对于 Dotcloud 上的 NodeJS,Web 服务器只是一种工作服务。

您的supervisord.conf是正确的,您不需要更改目录。虽然我不确定命令中的“NODE_ENV=生产”。

您可以通过将其添加到supervisord.conf来添加环境变量:

environment = NODE_ENV=production

请参阅此处了解更多信息:http:// /supervisord.org/configuration.html?highlight=environment

请参阅此处查看 dotcloud 上的节点supervisord.conf 示例:https://github.com/andzdroid/Batteries/blob/master/www/supervisord .conf

如果你想运行另一个工作服务,你的supervisord.conf看起来是一样的,你只需要更改命令:

[program:node]
command = node worker.js

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:

environment = NODE_ENV=production

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:

[program:node]
command = node worker.js
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文