mdn / yari

The platform code behind MDN Web Docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dockerize?

peterbe opened this issue · comments

There are many advantages with using Docker.

Pros

  • In CI - Get out of however Travis does Node. This way the only determining input variable for what version of Node and yarn we get is the version string of node we specify in the Dockerfile. For example, as of today Travis preinstalls an ancient version of yarn and there's no roadmap to that updating.

  • If we build a docker image, that contains ALL the rendered out .html files ready to be served, we can simply ship that docker container from Travis to Dockerhub and use something like Netlify to run that docker image.

  • For local development, every human developer would get the exact same version of Node and Yarn.

  • For local development, with a good docker-compose you would no longer need to "Open two terminals and in one run this and in another run that". Just docker-compose up and you get a complete dev environment.

  • In CI, we would potentially have better control of caching. Instead of the cryptic Travis way of caching files.

Cons

  • Docker is slow. Sometimes makes it hard to do hacky, but necessary, debugging within installed node_modules.

  • Not everyone is as comfortable with Docker as they are with pure Node and stuff. Possibly more applicable to contributors but on the flip-side being able to just say "To get started, run docker-compose up and you're off to the races".

  • Too soon? We're not entirely sure where we're going with the outcome of this project so perhaps it's fine to leave it a bit "pure" and flat at the moment.

I would strongly encourage using Docker for all of the reasons that @peterbe so nicely outlined. Two big thumbs up for dockerization from me! 👍 👍 😄