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
830
モダンとレガシー #gotandaem
rymizuki
0
590
Vuexに型を付けるパターンを調べた #gotandajs
rymizuki
0
150
マネージャー!きみは何者だ! #gotandaem
rymizuki
0
1.8k
物語を楽しむための物語論
rymizuki
0
560
失敗と向き合う
rymizuki
0
1.5k
社内勉強会と組織の成長を考える
rymizuki
1
2.7k
Other Decks in Technology
See All in Technology
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/3 - 2026/5
oracle4engineer
PRO
1
230
AWSシリコン最前線 〜AI時代のチップ選択を読み解く〜
htokoyo
2
280
AIソロプレナー時代に2ヶ月で20人増員した事業創造会社の開発組織の話
miyatakoji
0
260
Platform Engineering as a Product: Criteria for Improvement and Multi-Tenant Design
kumorn5s
0
530
AI Testing Talks: Challenges of Applying AI in Software Testing: From Hype to Practical Use
exactpro
PRO
1
140
Databricks における 生成AIガバナンスの実践
taka_aki
1
360
AI活用を推進するために ファインディが下した、一つの小さな決断
starfish719
0
280
関西に縁あるMicrosoft MVPsが語るCopilotの未来
kasada
0
1.2k
サイバーセキュリティ概論 / Introduction to Cybersecurity
ks91
PRO
0
170
実装は速くなった、レビューはどうする? ― 自身のレビューをAIで再現させるサーヴァントエンジニアリングのすゝめ / Implementation got faster. So what about reviews? — An invitation to Servant Engineering: Recreating your own code reviews with AI
nrslib
7
4.3k
AI-DLCを活用した高品質・安全なAI駆動開発実践 / AI Driven Development with AI-DLC
yoshidashingo
0
160
PHP と TypeScript の型システム比較:AI 時代の「型」は誰のためにあるのか? #frontend_phpcon_do / frontend_phpcon_do_2026
shogogg
1
270
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
Mind Mapping
helmedeiros
PRO
1
240
4 Signs Your Business is Dying
shpigford
187
22k
Speed Design
sergeychernyshev
33
1.8k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Being A Developer After 40
akosma
91
590k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
A designer walks into a library…
pauljervisheath
211
24k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
390
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