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.release
step necessary? Locally, I can setPHX_SERVER
to true and run my release with the onlymix release
– Phoenix works (although I’m having trouble making this work on prod). - Is there a
path
option thatphx.gen.release
can use? I’d like to keep the existing binary executable so we don’t need to refactor our terraform. If I omit thepath
option, things work, but thephx.gen.release
creates 2 artifacts:
_build/dev/rel/my_app/bin/server
_build/dev/rel/my_app/bin/my_app