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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
mizuki_r
May 10, 2019
Technology
3
410
DockerでNodeの開発は厳しいのか? #gotandajs
mizuki_r
May 10, 2019
Tweet
Share
More Decks by mizuki_r
See All by mizuki_r
FrontendUp_新規事業で_Remixを採用した理由と対策.pdf
rymizuki
0
220
税理士ドットコムの 技術的挑戦 #tapioca_lt
rymizuki
0
290
PHPを始めて1年、レガシーシステムにどう向き合っているか #phpstudy
rymizuki
1
780
モダンとレガシー #gotandaem
rymizuki
0
580
Vuexに型を付けるパターンを調べた #gotandajs
rymizuki
0
140
マネージャー!きみは何者だ! #gotandaem
rymizuki
0
1.8k
物語を楽しむための物語論
rymizuki
0
540
失敗と向き合う
rymizuki
0
1.5k
社内勉強会と組織の成長を考える
rymizuki
1
2.7k
Other Decks in Technology
See All in Technology
Meshy Proプラン課金した
henjin0
0
170
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
130
みんなだいすきALB、NLBの 仕組みから最新機能まで総おさらい / Mastering ALB & NLB: Internal Mechanics and Latest Innovations
kaminashi
0
170
re:Inventで出たインフラエンジニアが嬉しかったアップデート
nagisa53
4
230
What happened to RubyGems and what can we learn?
mikemcquaid
0
180
セキュリティについて学ぶ会 / 2026 01 25 Takamatsu WordPress Meetup
rocketmartue
1
210
Introduction to Bill One Development Engineer
sansan33
PRO
0
350
Databricks Free Edition講座 データサイエンス編
taka_aki
0
270
2026年、サーバーレスの現在地 -「制約と戦う技術」から「当たり前の実行基盤」へ- /serverless2026
slsops
2
130
システムのアラート調査をサポートするAI Agentの紹介/Introduction to an AI Agent for System Alert Investigation
taddy_919
2
1.3k
JuliaTokaiとしてはこれが最後かもしれない(仮) for NGK2026S
antimon2
0
130
Amazon Bedrock AgentCore 認証・認可入門
hironobuiga
2
470
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
6k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Fireside Chat
paigeccino
41
3.8k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
The untapped power of vector embeddings
frankvandijk
1
1.6k
YesSQL, Process and Tooling at Scale
rocio
174
15k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Design in an AI World
tapps
0
140
How to build a perfect <img>
jonoalderson
1
4.9k
エンジニアに許された特別な時間の終わり
watany
106
230k
The Cult of Friendly URLs
andyhume
79
6.8k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
55
49k
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