Distillery not start app Phoenix

I created an elixir project with phoenix and added dependency on the distillery.
I’m just in doubt that I do not have my application started.

I’m running that way.

mix distillery.release --env=prod

_build/dev/rel/test/bin/test foreground

Access
http://localhost:4000/ - not found

It’s probably because “server: true” is not configured on the endpoint. By default, in dev environment phoenix server is only started if you start the app with mix task, as in “iex -S mix phx.server” or “mix phx.server”… If you just start the app with “iex -S mix” no server starts unless you tell Phoenix to start it automatically.

This is precisely the same case with releases. If you intend to start your app in dev mode as a release, flip the “server: true” flag in confing, just like it is in prod.exs:

config :my_app, MyApp.Endpoint,
  server: true,
 ...
4 Likes