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
420
3
Share
DockerでNodeの開発は厳しいのか? #gotandajs
mizuki_r
May 10, 2019
More Decks by mizuki_r
See All by mizuki_r
FrontendUp_新規事業で_Remixを採用した理由と対策.pdf
rymizuki
0
240
税理士ドットコムの 技術的挑戦 #tapioca_lt
rymizuki
0
300
PHPを始めて1年、レガシーシステムにどう向き合っているか #phpstudy
rymizuki
1
830
モダンとレガシー #gotandaem
rymizuki
0
590
Vuexに型を付けるパターンを調べた #gotandajs
rymizuki
0
150
マネージャー!きみは何者だ! #gotandaem
rymizuki
0
1.8k
物語を楽しむための物語論
rymizuki
0
550
失敗と向き合う
rymizuki
0
1.5k
社内勉強会と組織の成長を考える
rymizuki
1
2.7k
Other Decks in Technology
See All in Technology
AIの揺らぎに“コシ”を与える階層化品質設計
ickx
0
270
多角的な視点から見たAGI
terisuke
0
130
ServiceによるKubernetes通信制御ーClusterIPを例に
miku01
1
160
全社統制を維持しながら現場負担をどう減らすか〜プラットフォームチームとセキュリティチームで進めたSecurity Hub活用によるAWS統制の見直し〜/secjaws-security-hub-custom-insights
mhrtech
1
410
AI-Assisted Contributions and Maintainer Load - PyCon US 2026
pauloxnet
1
110
要件定義の精度を高めるための型と生成AIの活用 / Using Types and Generative AI to Improve the Accuracy of Requirements Definition
haru860
0
320
「QA=テスト」「シフトレフト=スクラムイベントの参加者の一員」の呪縛を解く。アジャイルな開発を止めないために、10Xで挑んだ「右側のしわ寄せ」解消記 #scrumniigata
nihonbuson
PRO
5
1.2k
そのSLO 99.9%、本当に必要ですか? 〜優先度付きSLOによる責任共有の設計思想〜 / Is that 99.9% SLO really necessary? Design philosophy of shared responsibility through prioritized SLOs
vtryo
0
600
Sociotechnical Architecture Reviews: Understanding Teams, not just Artefacts
ewolff
1
170
QAエンジニアはどうやって プロダクト議論の場に入れるのか?
moritamasami
2
420
新卒エンジニア研修、ハンズオンの設計における課題と実践知/ #tachikawaany
nishiuma
2
140
ESP32 IoTを動かしながらメモリ使用量を観測してみた話
zozotech
PRO
0
110
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.4k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
690
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.4k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
130
HDC tutorial
michielstock
2
650
Are puppies a ranking factor?
jonoalderson
1
3.4k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
510
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.1k
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