How to choose between mix release and distillery?

I’m newbie to elixir and phoenix here.

Distillery was made before mix release? Is mix release and docker enough for deploy a phoenix application?

Thanks :slight_smile:

Depends on what you want to do. You don’t even need docker; I know I don’t

1 Like

hi derek, thanks for your reply,

as the doc sugguests,

it is best to ensure the operating system and system package manager have the same versions on host and target.

and i’m on macOS, and want to deploy on ubuntu, and got not executable format error yesterday,

and also i know a little about docker and k8s, so i guess i might need docker.

just want to know how to choose between mix release and distillery. :smile:

Yes, distillery predates mix release. I only have experience with mix release and it does the job.

Mix releases are sufficient if you don’t need hot code swaps.

So a few years ago, I put together a CI workflow involving distillery and config_tuples (used to inject runtime variables).

Last week, I was thinking of a new project and mix release in 1.11 looks like it has everything needed now:

  • can start in foreground with logs to stdout
  • runtime configuration through environmental variables
  • bundling of erts,etc.
  • connect a remote shell

The important docs are at:
phoenix docs for using mix release and mix release

Remember though, if you want to deploy on a remote system, the release needs to have the exact same version of erlang/erts and architecture. So you may need docker to either build the release for the arch or you can deploy it in docker.

So, at this point, I would go with the default release solution rather than distillery. When I first put together the distillery solution, it took me a few hours. For mix release, I just followed the instructions.

Incredible ease of use.

Last month I had the same question and went through the process of trying out both. Then I picked mix release for it’s ease of use. I also don’t need hot code upgrade.

As I am using gitlab, I use pipeline to build the image in ubuntu and push to my production server, which is also in ubuntu. I do not use docker in my production server, but the pipeline is using docker in itself.

Here is the article that I documented the steps: https://blog.commonsenseofmagic.site/posts/phoenix-release-gitlab-cicd/

Hope you find it useful.

2 Likes