Getting Elxir deployed can be challenging. Especially if you want to do it the Erlang way. This talk provides some guidelines on what to take care of.
Elixir Releases
View Slide
The Way/app/*.rb/lib/*.rbGemfile$ install requirements$ export RAILS_ENV=production$ bundle install$ bundle exec rails server
gjaldon/heroku-buildpack-phoenix-staticHashNuke/heroku-buildpack-elixir
?
Build Run$ mix deps.get$ mix release$ _build/app startapp.tar.gz:- Binaries- Erlang runtime (optional)- Sources (optional)
WatchOut
Build Run$ mix deps.get$ mix release —env=prod$ _build/app startapp.tar.gz
$ docker run image_that_is_like_runtime build.sh
$ _build/app start** (Postgrex.Error) ERROR42P01 (undefined_table):relation "users" does notexist
$ mix ecto.migrate-bash: mix: command notfound
$ _build/app migrate$ _build/app starthttps://github.com/bitwalker/distillery/blob/master/docs/Running%20Migrations.md
Configurationstagingdemotestingsandboxproduction
use Mix.Configconfig :app, App.Repo, [database: "app",username: "user",password: "supersecret",hostname: “db-server”,port: 5432,]{'Elixir.QualityControl.Repo',[{database,<>},{username,<>},{password,<>},{hostname,<>},{loggers,[]},{port,5433}]},config.exssys.config
use Mix.Configconfig :app, App.Repo, [database: "app",username: “user",password:System.get_env(“PG_PASS"),hostname: “db-server”,port: 5432,]config.exssys.config{'Elixir.QualityControl.Repo',[{database,<>},{username,<>},{password,nil},{hostname,<>},{loggers,[]},{port,5433}]},
Replace Variables on Build System{:system, ENV, default}Check In CredentialsREPLACE_OS_VARS=trueBuild Config Layer
Why
Because it's cool?
Size300 MB 50 MB
Resources
Code Reload
Comfortable
Start EarlyThink About ConfigUse Distillery