Multistage Elixir 1.11.0 Phoenix (LiveView) Release Dockerfile

Hey folks! Just wanted to share this gist that I put together to help anyone who’s doing Phoenix/LiveView development. I had trouble finding an Elixir 1.11.0 Docker image, but luckily this thread pointed me in the right direction.

It’s optimized to get and compile mix and npm deps. If you aren’t using LiveView, I’ve added a couple of comments where you could remove instructions.

Cheers :beers:

5 Likes

One thing though - I would use Debian/Ubuntu/CentOS as a base image instead of Alpine, as these distributions have better security policies and since OverlayFS the base image size became non-issue.

1 Like

There is nothing wrong with Alpine.

What I don’t like about Debian/Ubuntu (haven’t tried CentOS) is the amount of packages it installs during build. Takes much more time to build an Ubuntu based image, than it is for Alpine.

4 Likes

Yeah, to be fair I haven’t thought much about security here.
Regardless of distro this still serves as a solid base for folks moving forward :smiley: