如何启动phoenix.server作为守护进程

sha*_*evy 13 elixir phoenix-framework

下面的命令在生产模式下运行phoenix.server,并作为部署phoenix的命令给出.

MIX_ENV=prod PORT=4001 iex -S mix phoenix.server
Run Code Online (Sandbox Code Playgroud)

但是,上面的命令以交互方式运行服务器并关闭终端,阻止phoenix.server运行.如何让phoenix.server在后台运行?

Jos*_*lim 32

这应该做的伎俩:

MIX_ENV=prod PORT=4001 elixir --erl "-detached" -S mix phx.server
Run Code Online (Sandbox Code Playgroud)

检查elixir --help更多信息.

  • 可以将此信息添加到http://www.phoenixframework.org/v0.12.0/docs/deployment吗?它可以帮助其他人在正确的地方找到正确的信息. (4认同)