Elixir/Phoenix Dockerfile
Dockerfile for Elixir 1.2/Erlang 18.* includes libsass and npm 5.x for compiling dependencies.
Warning
This is not a small, beautiful dockerfile. It's a huge, monstrosity of one that has everything and the kitchen sink in it. It's designed to build a phoenix app and it's dependencies, save them to a shared directory and then use a second, minimalist Dockerfile as the container to run it in BUT to keep things a bit simpler, I've put a phoenix run in there so that it works out of the box, you should change that to fit your situation.
With that said, lots of caching happens so that in day-to-day work, you should only be seeing the final COPY/RUN happen.
About
- Starts with debian jessie because all my stuff does (purely personal preference).
- Lots of dependencies for building libsass and npm for brunch
- Install erlang, elixir and node
- Install hex and rebar
- Build libsass
- copy your package.json file and install node dependencies (good for caching since these don't change often), (the rebuild node-sass gets around and issue that took a lot of googling to figure out)
- copy the webapp (this does bust caching of mix.esx and mix.lock but I've had issues there)
- and finally compile the whole thing including brunch assets