Initialize your git repository git init. This would save you later a step to add heroku as remote.
Move configuration from config/prod.secret.exs to config/prod.exs and replace the following parts:
config :app_name, AppName.Endpoint,
secret_key_base: System.get_env("SECRET_KEY_BASE")
# Configure your database
config :app_name, AppName.Repo,
adapter: Ecto.Adapters.Postgres,
url: System.get_env("DATABASE_URL"),
size: 20 # The amount of database connections in the poolRemove import_config "prod.secret.exs" from config/prod.exs.
Remove config/prod.secret.exs file and its line in .gitignore.
Create Heroku App:
heroku create app-name --region euSet the buildpacks stack:
heroku buildpacks:set https://github.com/gjaldon/phoenix-static-buildpack
heroku buildpacks:add --index 1 https://github.com/HashNuke/heroku-buildpack-elixir
# Buildpack added. Next release on app-name will use:
# 1. https://github.com/HashNuke/heroku-buildpack-elixir
# 2. https://github.com/gjaldon/phoenix-static-buildpackCreate Procfile:
mix phoenix.server
Create elixir_buildpack.config:
erlang_version=17.5
elixir_version=1.0.5
always_rebuild=true
config_vars_to_export=(DATABASE_URL SECRET_KEY_BASE)
Create phoenix_static_buildpack.config:
node_version=0.12.7
npm_version=2.11.3
config_vars_to_export=(DATABASE_URL SECRET_KEY_BASE)
Set SECRET_KEY_BASE ENV variable in Heroku:
heroku config:set SECRET_KEY_BASE=some_secret_keyCommit the changes:
git commit -m "Configure app to run on Heroku"Push to Heroku:
git push heroku