什么是Procfile?和网络和工作者 [英] What is Procfile? and Web and Worker

查看:1101
本文介绍了什么是Procfile?和网络和工作者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有必要在Procfile中提供'worker'信息?如果是,那么它实际上是什么 - 无法找到关于此的好文章。我希望你们有想法。我已经在Procfile中添加了web:node server / server.js详细信息。任何帮助,将不胜感激!

Is it necessary to give 'worker' information in Procfile? If yes then what it is actually - couldn't find nice article regarding this. I hope you guys might have idea. I have already added web: node server/server.js detail in the Procfile. Any help would be appreciated!

推荐答案


Procfile是一种机制,用于声明Heroku平台上应用程序的dynos运行的命令。

Procfile is a mechanism for declaring what commands are run by your application’s dynos on the Heroku platform.

过程类型和Procfile ,这是一个很好的介绍,但基本上你使用Procfile来告诉Heroku如何运行你的应用程序的各个部分。每行上冒号左边的部分是过程类型;

From Process Types and the Procfile, which is a good introduction, but basically you use the Procfile to tell Heroku how to run various pieces of your app. The part to the left of the colon on each line is the process type; the part on the right is the command to run to start that process.

虽然 web 是特殊的,因为Heroku会将HTTP请求路由到以 web 名称开头的进程。其他进程(如后台工作人员)可以被命名为任何东西,您可以使用Heroku工具带通过引用其名称来启动或停止这些进程。

Process types can be anything, although web is special, as Heroku will route HTTP requests to processes started with the web name. Other processes, such as background workers, can be named anything, and you can use the Heroku toolbelt to start or stop those processes by referring to its name.

因此,在简而言之, worker 是不必要的,除非您想通过 heroku ps 命令控制进程。

So, in short, worker is not necessary, unless you want to run some other process in the background by controlling process with the heroku ps command.

这篇关于什么是Procfile?和网络和工作者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆