- Easy configuration with
elixir_buildpack.config
file - Use prebuilt Elixir binaries or build from source
- Mix dependency caching
- Adds the free Heroku Postgres database upon app creation
DATABASE_URL
is made available at compile time- Allows configuring Erlang
- If your app doesn't have a Procfile, default web task
mix server -p $PORT
will be run. - Consolidates protocols
- Hex and rebar support
- Erlang - Prebuilt packages (17.0, R16B03-1, etc)
- Elixir - Prebuilt binaries or build from a branch, tag or a commit
heroku create --buildpack "https://github.com/HashNuke/heroku-buildpack-elixir.git"
heroku config:set BUILDPACK_URL="https://github.com/HashNuke/heroku-buildpack-elixir.git"
Create a elixir_buildpack.config
file in your app's root dir. The file's syntax is bash.
If you don't specify a config option, then the default option from the buildpack's elixir_buildpack.config
file will be used.
Here's a full config file with all available options:
# Erlang version
erlang_version=17.0
# Elixir version
elixir_version=0.12.5
# Do dependencies have to be built from scratch on every deploy?
always_build_deps=false
- Build Elixir from a branch. If you specify a branch, that particular Elixir branch will be re-downloaded and built from source every time you deploy.
elixir_version=(branch master)
- Build Elixir from a tag
elixir_version=(tag v0.12.5)
- Build Elixir from a particular commit
elixir_version=(commit b07fbcf8b73e)
- You can either specify a stable Erlang release version like below
erlang_version=R16B03-1
- OR you can specify that Erlang builds from the master branch must be used
erlang_version=(branch master)
Note that if you specify the master branch of Erlang, then it is Heroku's periodic builds that will be used. I don't work for Heroku, but I'm assuming that's why they have master branch builds.
-
Add your own
Procfile
to your application, else the default web taskmix server -p $PORT
will be used. -
To make use of consolidated protocols they need to be added to the loadpath. Example:
elixir -pa _build/prod/consolidated -S mix run --no-halt
. -
If you create an application with this buildpack, then a free database addon
heroku-postgresql:hobby-dev
is also added. The database credentials are available from the env varDATABASE_URL
.
© Akash Manohar under The MIT License. Feel free to do whatever you want with it.