node アプリ + HTML/CSS/JavaScript のリポジトリを Dockernize したときの話。最近 Docker の機運が高まっているのはたまたまです。 同じプロジェクトのバックエンドのリポジトリ(ただし別言語)が Dockerfile 内で依存解決をしていたので、おもむろに RUN cd /src && npm i && npm run build 的な処理を記述したら時間がかかりすぎて爆死しました。 予想はしてましたが node_modules 以下の依存ツリーが肥大化しているのが原因です。 $ du -k -d 1 node_modules | sort -nr 466792 node_modules 85224 node_modules/sc5-styleguide 60400 node_modules/gulp-svg-sprite 32844 node_mo
![プロジェクトの Dockernize と肥えた node_modules](https://cdn-ak-scissors.b.st-hatena.com/image/square/2183e9bbc25dbbdb50624f0d9497aa7861959398/height=288;version=1;width=512/https%3A%2F%2Fhavelog.aho.mu%2Fogp-default.jpg)