From cbd42e8f59001532d6da05ed4fd4fdca338c85b1 Mon Sep 17 00:00:00 2001 From: Shankar Dhanasekaran Date: Mon, 11 May 2015 20:25:32 +0530 Subject: [PATCH] Add info on running phoenix in detached mode --- K_deployment.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/K_deployment.md b/K_deployment.md index 1db58074..154ead86 100644 --- a/K_deployment.md +++ b/K_deployment.md @@ -8,6 +8,15 @@ Now that we've got our application prepared for production, getting it running i MIX_ENV=prod PORT=4001 iex -S mix phoenix.server ``` +We can run our application detached from the iex console. This effectively daemonizes the process so it can run independently in the background. The command to do that looks like the following. + +```elixir +MIX_ENV=prod PORT=4001 elixir --detached -S mix phoenix.server +``` + +Running the application in detached mode allows us to keep the application running even after we terminate the shell connection with the server. + + For guidance on deploying with Erlang style releases, please check out the [Advanced Deployment Guide](http://www.phoenixframework.org/docs/advanced-deployment) Note, with new Phoenix projects created using Elixir 1.0.4, protocol consolidation happens automatically when we start a Phoenix server with `MIX_ENV=prod`. (Actually, any Phoenix specific mix task will consolidate protocols when invoked with `MIX_ENV=prod`.)