- Ecto
- Postgrex
- Distillery
Create a config/prod.secret.exs
(see
example.prod.secret.exs)
Then do:
MIX_ENV=prod mix do compile, release --env=prod --verbose
docker build -t epoch:[tag] .
The image will copy config/docker.secret.exs
to config/prod.secret.exs
, which
allows configuration through environment variables.
username: System.get_env("DATABASE_USER"),
password: System.get_env("DATABASE_PASSWORD"),
database: System.get_env("DATABASE_NAME"),
hostname: System.get_env("DATABASE_HOST"),
Run database migrations:
_build/prod/rel/epoch/bin/epoch command Elixir.Epoch.ReleaseTasks migrate
Note _build/prod/rel/epoch/bin/epoch
can be where the binary is placed once
deployed.
Setup Erlang/Elixir: http://elixir-lang.org/install.html OS X (AKA easy mode): brew install elixir
mix deps.get
mix ecto.setup
mix ecto.drop
- drop dbmix ecto.create
- create new dbmix ecto.migrate
- migrationmix do ecto.drop, ecto.create, ecto.migrate
- drop/create/migrate in 1 command Configuration of database settings are in config/config.exs