Skip to content

Phoenix & Elm starter app, using Brunch, for Heroku deployment

Notifications You must be signed in to change notification settings

ferikeng/phoenix-elm-heroku

Repository files navigation

Phoenix + Elm + Brunch starter app, ready for Heroku deployment

Introduction

This is a very basic Phoenix and Elm application that can be used as a starting point for new applications. It has been configured for deployment to Heroku. It is using Brunch to build all assets.

The application has been built using Phoenix v1.3.0-rc.2 and Elm 0.18.

Installation

  1. Clone the repo and make sure to have the heroku toolbelt installed. In the project root, run:
mix deps.get
heroku create --buildpack "https://github.com/HashNuke/heroku-buildpack-elixir.git"
heroku buildpacks:add https://github.com/gjaldon/heroku-buildpack-phoenix-static.git
heroku addons:create heroku-postgresql:hobby-dev
heroku config:set POOL_SIZE=18
  1. In config/prod.exs, replace the placeholder "REPLACE_WITH_HEROKU_APPLICATION_NAME" with whatever name heroku gave you when you ran heroku create, and commit the changes.

  2. Now run mix phx.gen.secret and copy-paste the returned string into the command heroku config:set SECRET_KEY_BASE="<insert_secret_key_here>",

  3. Before deploying, let's test to make sure the application runs locally. Run:

cd assets && npm install --save-dev elm-brunch elm && cd ..
mix phx.server

Then visit localhost:4000 from your browser.

  1. Finally, deploy using git push heroku master and visit your app using heroku open

If deployment fails

If Heroku deployment fails due to version issues, you may need to create a file elixir_buildpack.config in the application root dir, with contents:

erlang_version=X.X
elixir_version=Y.Y

To find the version numbers:

In case of any other issues, check, e.g.:

About

Phoenix & Elm starter app, using Brunch, for Heroku deployment

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published