- Easy configuration with
elixir_buildpack.config
file - Use prebuilt Elixir binaries
- Adds the free Heroku Postgres database upon app creation
DATABASE_URL
can be made available at compile time adding it toconfig_vars_to_export
inelixir_buildpack.config
- 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
- Caching of Hex packages, Mix dependencies and downloads
- Erlang - Prebuilt packages (17.2, 17.1, etc)
- Elixir - Prebuilt releases (1.0.0, 0.15.1 etc) or prebuilt branches (master, stable, etc)
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.2
# Elixir version
elixir_version=1.0.0
# Always rebuild from scratch on every deploy?
always_rebuild=false
# Export heroku config vars
config_vars_to_export=(DATABASE_URL)
- Use prebuilt Elixir release
elixir_version=1.0.0
- Use prebuilt Elixir branch, the branch specifier ensures that it will be downloaded every time
elixir_version=(branch master)
- You can specify an Erlang release version like below
erlang_version=17.2
- To set a config var on your heroku node you can exec from the shell:
heroku config:set MY_VAR=the_value
- Add the config vars you want to be exported in your
elixir_buildpack.config
file:
config_vars_to_export=(DATABASE_URL MY_VAR)
-
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.