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?
This should do the trick:
MIX_ENV=prod PORT=4001 elixir --erl "-detached" -S mix phx.server
Check elixir --help
for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With