heroku-buildpack-phoenix-static

Phoenix Static Buildpack

Purpose

This buildpack is meant to be used with the Heroku Buildpack for Elixir. When deploying Phoenix apps to Heroku, static assets will need to be compiled. This buildpack sees to it that static assets are compiled and that a corresponding asset manifest is generated.

# Clean out cache contents from previous deploys
clean_cache=false
# We can change the filename for the compile script with this option
compile="compile"# We can set the version of Node to use for the app here
node_version=5.3.0
# We can set the version of NPM to use for the app here
npm_version=2.10.1
# We can set the path to phoenix app. E.g. apps/phoenix_app when in umbrella.
phoenix_relative_path=.
# Remove node and node_modules directory to keep slug size down if it is not needed.
remove_node=false
# We can change path that npm dependencies are in relation to phoenix app. E.g. assets for phoenix 1.3 support.
assets_path=.
# We can change phoenix mix namespace tasks. E.g. phx for phoenix 1.3 support.
phoenix_ex=phoenix

Compile

By default, Phoenix uses brunch and recommends you to use mix phoenix.digest in production. For that, we have a default compile shell script which gets run after building dependencies and
just before finalizing the build. The compile file looks like this.

To customize your app's compile hook, just add a compile file to your app's root directory.
compile is just a shell script, so you can use any valid bash code. Keep in mind you'll have
access to your node_modules and mix. This means that if you're using a Node build tool other than brunch, you can just do something like: