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
3
340
DockerでNodeの開発は厳しいのか? #gotandajs
mizuki_r
May 10, 2019
Tweet
Share
More Decks by mizuki_r
See All by mizuki_r
税理士ドットコムの 技術的挑戦 #tapioca_lt
rymizuki
0
230
PHPを始めて1年、レガシーシステムにどう向き合っているか #phpstudy
rymizuki
1
560
モダンとレガシー #gotandaem
rymizuki
0
460
Vuexに型を付けるパターンを調べた #gotandajs
rymizuki
0
100
マネージャー!きみは何者だ! #gotandaem
rymizuki
0
1.6k
物語を楽しむための物語論
rymizuki
0
460
失敗と向き合う
rymizuki
0
1.2k
社内勉強会と組織の成長を考える
rymizuki
1
2.4k
Webpackのビルド時間を1/3にした話 #gotandajs
rymizuki
9
4k
Other Decks in Technology
See All in Technology
Databricks におけるデータエンジニアリング
databricksjapan
0
380
「手動オペレーションに定評がある」と言われた私が心がけていること / phpcon_odawara2024
blue_goheimochi
2
320
複雑な構成要素を持つUIとの向き合い方 〜新・支出グラフでの実例〜 / B43 TECH TALK
nakamuuu
0
110
**強い**エンジニアのなり方 - フィードバックサイクルを勝ち取る / grow one day each day
soudai
61
18k
コンパウンドスタートアップのためのスケーラブルでセキュアなInfrastructure as Codeパイプラインを考える / Scalable and Secure Infrastructure as Code Pipeline for a Compound Startup
yuyatakeyama
3
2.8k
Terraformあれやこれ/terraform-this-and-that
emiki
6
520
テストプロセスで大事にしていること #jasstnano
makky_tyuyan
0
130
Data and AI Governance: Existing Challenges and Emerging Trends
scotthsieh825
0
160
プロトタイピングによる不確実性の低減 / Reducing Uncertainty through Prototyping
ohbarye
3
240
Oracle Cloud Infrastructure:2024年4月度サービス・アップデート
oracle4engineer
PRO
1
110
インシデントレスポンスのライフサイクルを廻すポイントってなに / Pinpoints of Incidentresponse Lifecycle for Operation
sakaitakeshi
1
300
アプリがつくるNOT A HOTELブランド
hokuts
1
450
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
72
8.2k
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
What the flash - Photography Introduction
edds
64
11k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
39
4.4k
Agile that works and the tools we love
rasmusluckow
324
20k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
5
1.5k
Statistics for Hackers
jakevdp
789
220k
For a Future-Friendly Web
brad_frost
171
8.9k
Why You Should Never Use an ORM
jnunemaker
PRO
50
8.6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
115
18k
A designer walks into a library…
pauljervisheath
199
23k
Infographics Made Easy
chrislema
237
18k
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