shankardevy
shankardevy

Reputation: 4370

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?

Upvotes: 18

Views: 7998

Answers (1)

José Valim
José Valim

Reputation: 51349

This should do the trick:

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

Check elixir --help for more information.

Upvotes: 46

Related Questions