Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
DockerでNodeの開発は厳しいのか? #gotandajs
Search
mizuki_r
May 10, 2019
Technology
420
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
DockerでNodeの開発は厳しいのか? #gotandajs
mizuki_r
May 10, 2019
More Decks by mizuki_r
See All by mizuki_r
FrontendUp_新規事業で_Remixを採用した理由と対策.pdf
rymizuki
0
250
税理士ドットコムの 技術的挑戦 #tapioca_lt
rymizuki
0
310
PHPを始めて1年、レガシーシステムにどう向き合っているか #phpstudy
rymizuki
1
840
モダンとレガシー #gotandaem
rymizuki
0
600
Vuexに型を付けるパターンを調べた #gotandajs
rymizuki
0
150
マネージャー!きみは何者だ! #gotandaem
rymizuki
0
1.8k
物語を楽しむための物語論
rymizuki
0
560
失敗と向き合う
rymizuki
0
1.5k
社内勉強会と組織の成長を考える
rymizuki
1
2.8k
Other Decks in Technology
See All in Technology
CVE-2026-20833_脆弱性対応とAES 化について
jukishiya
0
300
スタートアップにおけるアジャイルの実践について #shibuyagile
murabayashi
2
860
Text-to-SQLをAgentCoreで実現し、生成されるSQLの精度を定量的に評価する
yakumo
2
260
AI・ロボティクスと自動化社会 / AI, Robotics, and the Automated Society
ks91
PRO
0
120
WebGIS AI Agentの紹介
_shimizu
0
600
Why is RC4 still being used?
tamaiyutaro
0
260
AIDLC_ヤフーショッピングの取り組み
lycorptech_jp
PRO
0
230
AI-DLCを “そのまま導入しなかった”話 ~組織に合わせてアジャストした 私たちの実践共有~
hiroramos4
PRO
1
480
IaC コードを資産へ:AWS CDK 社内ライブラリと横断展開 / aws-summit-japan-2026
gotok365
10
1.7k
“ID沼入口” - 基本とセキュリティから始める、考え続けるためのID管理技術勉強会 告知&イントロ
ritou
0
340
NDIAS CTF 2026 問題解説会資料
bata_24
0
150
フロントエンドイチゲキ実装 ― Figmaデザインと画面設計書からAIに実装・テストを書かせるための”下ごしらえ” / 20260627 Yusuke Mazuka
shift_evolve
PRO
0
110
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
330
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
170
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
380
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
The Invisible Side of Design
smashingmag
301
52k
Automating Front-end Workflow
addyosmani
1370
210k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.9k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Building Adaptive Systems
keathley
44
3.1k
Designing Experiences People Love
moore
143
24k
Transcript
DockerでNodeの開発は厳しいのか? 2019/05/10 Gotanda.js #11 @mizuki_r
@mizuki_r 弁護士ドットコム株式会社 税理士ドットコム事業部/開発チーム チームマネージャー 2 自己紹介 JavaScript, Vue, Nuxt, Perl,
PHP, Docker, AWS, etc…
免責事項 • VS Code使いの意見です • intelijも試したかったけど時間が… • 所属する組織・団体の主張ではなく、個人 の意見です •
鵜呑みにせず、参考にとどめましょう
Node環境もDockerにしたい
Node on Dockerしたい • 複数プロジェクトを並列で開発している • グローバルインストールしたくない • ndenv, nvm,
etc, メンテしたくない • docker-composeに集約したい
Docker for Macは mounted volumeの IOが非常に遅い
IOが非常に遅い • mounted volumeの更新系が遅い • Nodeを用いた開発はファイルのW/Rが非常 に多くなる • npm install,
build処理など • これが遅いのは致命的
rm -rf node_modules/* && npm install 環境 実行時間 ホストマシン 14.93s
Docker with mounted volumes 86.83s
Dockerにmountしたvolume への更新は遅い
mountしなければいいのでは?
mounted volumeでの 大幅なIO更新をやめる
mounted volumeをやめる node_modulesを上書きして、ホストにマウントしなくする
rm -rf node_modules/* && npm install 環境 実行時間 ホストマシン 14.93s
Docker with mounted volumes 86.83s Docker without mounted volumes 20.22s
だいぶマシになった。
mounted volumeしないと 困るか?
VS Code使いあるある • eslint, typescriptのVS Code Serverがホ ストに必要 • node_modulesを直接参照(見る・書換る)
したい
コンテナの中で VS Code Serverを動かせればぁ…
VS Code Insiders
VS Code Insiders • vscodeの新機能を確認したり、テストした りするためのInsiders Programの後継 • 通常版のvscodeと同居でき、設定も別のエ ディタとして利用する
https://code.visualstudio.com/insiders/
Developing inside a Container • Remote Developmentの拡張を追加するこ とでSSH, Containers, WSLとの通信が可能
• リモートでVS Code Serverを実行し、リ モートの環境で行われたあれこれをホスト 側のVS Codeに反映してくれる https://code.visualstudio.com/docs/remote/containers
None
まとめ
まとめ • NodeJS on DockerはIOのマウントを外せ ば軽減する • VS CodeのInsiders buildを使うことでホ
ストにマウントせず開発ができる
実行環境
実行環境 • MBP 2018 Core i7 16GB • Docker version
18.09.2, build 6247962 • docker-compose version 1.23.2, build 1110ad01 • node v11.15.0
実験コード https://github.com/rymizuki/example-node-on-docker