Please install ASDF from https://asdf-vm.com/guide/getting-started.html
sudo apt install -y libssl-dev automake autoconf libncurses-dev dirmngr gpg curl gawk libzstd-dev inotify-tools
# Donload and install `asdf` from https://github.com/asdf-vm/asdf/releases
asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf plugin add elixir https://github.com/asdf-vm/asdf-elixir.git
asdf plugin add sbcl https://github.com/smashedtoatoms/asdf-sbcl.git
asdf install erlang latest
asdf install elixir latest
asdf install sbcl latest
vim $HOME/.tool-versions
$HOME/.tool-versions
# $HOME/.tool-versions
erlang 27.3.4
elixir 1.18.3-otp-27
sbcl 2.5.4
Add $HOME/.asdf/shims
to the front of your $PATH
.
nix-env -iA erlang_27
nix-env -iA elixir_1_17
nix-env -iA inotify-tools
mix local.hex --force
mix archive.install hex phx_new
export SECRET_KEY_BASE=$(mix phx.gen.secret)
export DATABASE_URL=ecto://{username}:{password}@{hostname}:{port}/{database-name}
mix deps.get --only prod
MIX_ENV=prod # for fish, `set -x MIX_ENV prod`
mix compile
mix assets.deploy
mix phx.gen.release --docker
# change `bullseye-20240423-slim` to `buster-20240423-slim` in Dockerfile
# export or add in Dockerfile; SECRET_KEY_BASE=$(mix phx.gen.secret)
docker build -t myapp:latest .
docker run -it -e {ENV_VAR=VALUE} -p {extern-port}:{inner-port} {image}:{tag} bash
mix hex.outdated
# update each version of modules in mix.exs file
mix hex.upgrade
mix deps.update --all
mix deps.get
mix compile