Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
DockerでNodeの開発は厳しいのか? #gotandajs
Search
mizuki_r
May 10, 2019
Technology
430
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
260
税理士ドットコムの 技術的挑戦 #tapioca_lt
rymizuki
0
320
PHPを始めて1年、レガシーシステムにどう向き合っているか #phpstudy
rymizuki
1
850
モダンとレガシー #gotandaem
rymizuki
0
600
Vuexに型を付けるパターンを調べた #gotandajs
rymizuki
0
160
マネージャー!きみは何者だ! #gotandaem
rymizuki
0
1.9k
物語を楽しむための物語論
rymizuki
0
570
失敗と向き合う
rymizuki
0
1.6k
社内勉強会と組織の成長を考える
rymizuki
1
2.8k
Other Decks in Technology
See All in Technology
AI 時代のスタートアップエコシステ厶から考究する技術的負債との向き合い方
m3m0r7
PRO
2
2.1k
Slack上でインフラをトラブルシュートする! Agentic Platform Engineeringの第一歩
teru0x1
5
1.7k
TinyGo 開発サイクルを高速化する:Go で作るエミュレータ入門
zozotech
PRO
1
740
目の前の楽しいが人生を変える - コミュニティの螺旋の歩き方と楽しむコツ / change your life
soudai
PRO
5
630
登壇の自信を奪う3匹のオバケ / 3 Ghosts That Rob You of Your Confidence in Public Speaking
pauli
9
960
データ_AIの事業の勝敗をわけるもの
nek0128
0
390
越境するなら専門用語を使うな高校校歌 / If you wanna cross border, you shouldn't use jargon
vtryo
0
140
安心して変更できるWebフロントエンドの作り方
pirosikick
5
2.6k
Snowflakeのコスト最適化を支えるアーキテクチャ設計
ktatsuya
1
1.6k
Minecraft JavaのMODをSwiftで作る
1mash0
0
170
[2026-09-11]SREは誰のもの?運用エンジニアが始める 「SRE領域への越境」とチームの進化の軌跡 〜Road to NEXT CRE
tosite
0
290
バイブコーディング時代のWebアプリ開発入門~Cloud Runで学ぶセキュアなビルドとデプロイ
waiwai2111
1
130
Featured
See All Featured
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
540
Automating Front-end Workflow
addyosmani
1369
210k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
280
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Writing Fast Ruby
sferik
630
63k
Technical Leadership for Architectural Decision Making
baasie
3
570
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
460
Git: the NoSQL Database
bkeepers
PRO
432
67k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
65k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
76k
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