📎 Webclip
Deploying Elixir's Phoenix Framework on Dokku
The gist shows how to prepare a Phoenix app for Dokku by configuring buildpacks, environment variables, and deploy settings on the app’s repo. It also notes that the instructions worked for Phoenix 1.0.1 on Dokku 0.3.25.
Reading notes#
- Create a Dokku app from the local repo with
ssh dokku apps:create my_app_name. - Set Dokku to use multiple buildpacks with
BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git. - Add the Elixir buildpack and the Phoenix static buildpack to
.buildpacks. - For Phoenix 1.1, the static buildpack may need
node_version=5.3.0inphoenix_static_buildpack.config. - The Elixir buildpack can be configured to lock Erlang and Elixir versions.
- Set
LC_ALL=en_US.utf8in Dokku to avoid a locale warning. - Store
SECRET_KEY_BASEin Dokku config and read it inconfig/prod.secret.exswithSystem.get_env("SECRET_KEY_BASE"). - Store
HOSTNAMEin Dokku config and read it inprod.exswithSystem.get_env("HOSTNAME"). - If the app uses a database, read
DATABASE_URLfrom config in the Repo settings. - Comment out
#/config/prod.secret.exsin.gitignoreso the secret-less file can be committed. - Commit the changes, add the Dokku remote, and push to deploy.
