The Heroku buildpacks make some assumptions about your project based on earlier versions, but with a few tweaks can be used with version 1.4 of Elixir and 1.3 of Phoenix.
This assumes you created your project with mix phx.new hello_phoenix --umbrella
. Replace hello_phoenix and HelloPhoenix with your app name where appropriate.
Most of the instructions at http://www.phoenixframework.org/docs/heroku are still valid. Complete those and then make the following changes:
config/prod.exs
mentioned is the one in the web app folder: hello_phoenix_umbrella/apps/hello_phoenix_web/config/prod.exs
.prod.exs
from HelloPhoenix.Endpoint
to HelloPhoenix.Web.Endpoint
.import_config "prod.secret.exs"
from hello_phoenix_umbrella/config/prod.exs
.phoenix_static_buildpack.config
in the root of your project and add the following line phoenix_relative_path=apps/hello_phoenix_web
.web: MIX_ENV=prod mix phx.server
.release: mix ecto.migrate
.elixir_buildpack.config
and set your Erlang and Elixir versions and runtime path (/app is the root of your project):
erlang_version=19.1elixir_version=1.4.2runtime_path=/app
There is an open issue to support Elm in the Phoenix buildpack 🤗. For now, if you’re compiling your Elm app with elm-brunch, you can just add elm
as a dependency to your apps/hello_phoenix_web/assets/package.json
.
Hacker Noon is how hackers start their afternoons. We’re a part of the @AMIfamily. We are now accepting submissions and happy to discuss advertising & sponsorship opportunities.
To learn more, read our about page, like/message us on Facebook, or simply, tweet/DM @HackerNoon.
If you enjoyed this story, we recommend reading our latest tech stories and trending tech stories. Until next time, don’t take the realities of the world for granted!