I’m working on adding Phoenix to an app that has previously operated without a web-server. I’m having trouble getting the release to run after deployment however.
I’ve noticed that mix phx.gen.release does not seem to look at the path option that are set in my mix.exs:
defp releases do
[
my_app: [
include_executables_for: [:unix],
steps: [:assemble, :tar],
overlays: ["envs/", "priv/", "config/"]
path: "_build/rel"
]
]
end
We peg all release builds to a single directory for simplicity: all variations in our app are runtime variants, so the compiled artifact is identical between environments so there’s no need to keep them separate, and this is referenced in Terraform to stop and start the systemctl service.
So I have 2 questions here…
- Is the
mix phx.gen.releasestep necessary? Locally, I can setPHX_SERVERto true and run my release with the onlymix release– Phoenix works (although I’m having trouble making this work on prod). - Is there a
pathoption thatphx.gen.releasecan use? I’d like to keep the existing binary executable so we don’t need to refactor our terraform. If I omit thepathoption, things work, but thephx.gen.releasecreates 2 artifacts:
_build/dev/rel/my_app/bin/server_build/dev/rel/my_app/bin/my_app






















