← 返回命令列表

Linux command

foreman 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Start

foreman start

Example

foreman start -f [Procfile]

Example

foreman start [process]

Validate

foreman check

Example

foreman run [command]

Example

foreman start -m all=1,worker=0

说明

foreman is a process manager for Procfile-based applications. It reads a Procfile that declares the processes that comprise your application and runs them in development, making it easy to manage multiple processes. A Procfile defines process types as lines with format name: command. For example: web: python app.py and worker: python worker.py. Foreman starts all defined processes and forwards their output to the terminal. Foreman also loads environment variables from .env files and can export process definitions to system init formats like systemd, upstart, or launchd for production deployment.

参数

start
Start all processes defined in the Procfile
check
Validate Procfile format
run
Run a one-off command using the app's environment
export
Export processes to another format (systemd, upstart, etc.)
-f, --procfile _FILE_
Specify an alternate Procfile
-d, --root _DIR_
Specify an alternate application root
-e, --env _FILE_
Specify environment file(s) to load
-m, --formation _SPEC_
Specify process formation (e.g., web=2,worker=1)
-p, --port _PORT_
Specify starting port number
-t, --timeout _SECONDS_
Specify shutdown timeout

FAQ

What is the foreman command used for?

foreman is a process manager for Procfile-based applications. It reads a Procfile that declares the processes that comprise your application and runs them in development, making it easy to manage multiple processes. A Procfile defines process types as lines with format name: command. For example: web: python app.py and worker: python worker.py. Foreman starts all defined processes and forwards their output to the terminal. Foreman also loads environment variables from .env files and can export process definitions to system init formats like systemd, upstart, or launchd for production deployment.

How do I run a basic foreman example?

Run `foreman start` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does start do in foreman?

Start all processes defined in the Procfile