Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start phoenix.server as daemon

The below command run the phoenix.server in production mode and is given as the command for deploying phoenix.

MIX_ENV=prod PORT=4001 iex -S mix phoenix.server

However, the above command run the server interactively and closing the terminal, stops the phoenix.server from running. How to have phoenix.server run in the background?

like image 981
shankardevy Avatar asked May 05 '15 18:05

shankardevy


1 Answers

This should do the trick:

MIX_ENV=prod PORT=4001 elixir --erl "-detached" -S mix phx.server

Check elixir --help for more information.

like image 160
José Valim Avatar answered Sep 19 '22 20:09

José Valim