Setting up Docker + TypeScript + Node (Hot reloading code changes in a running container) 🦄 🚀 Darian Sampare on January 31, 2021 I love TypeScript, and I love Docker. Putting these two together, however, can be a giant pain in the ass. Today I am going to walk you through ... Read full post Submit Preview Dismiss Collapse Expand Tom Crawford Tom Crawford Tom Crawford Follow Joined Oct 4, 2021 • Oct 4 '21 Dropdown menu Copy link Hide In order to make the production container, I had to add --build to the docker up command, so the up-prod Makefile entry became: docker-compose -f docker-compose.yml -f docker-compose.prod.yml up --build -d Collapse Expand Ryan Dsouza Ryan Dsouza Ryan Dsouza Follow A Web Dev and Guitarist who loves TypeScript and the Cloud :) Location India Work Full Stack Developer Joined Nov 14, 2018 • Jan 31 '21 • Edited on Jan 31 • Edited Dropdown menu Copy link Hide Great article! We would need to restart the container on installing a new module right? Collapse Expand Darian Sampare Darian Sampare Darian Sampare Follow Is it broken yet or do you want me to try fixing it again? Location Victoria BC Work Intermediate Full Stack Engineer at Certn Joined Jan 30, 2021 • Jan 31 '21 • Edited on Jan 31 • Edited Dropdown menu Copy link Hide Thanks Ryan! Yes you would. Most of it gets cached so rebuilding after installing another package should be much faster than the initial build. Collapse Expand Aadit Aadit Aadit Follow full stack web dev Location India Work student Joined Jan 16, 2021 • Jan 31 '21 Dropdown menu Copy link Hide 💯 Collapse Expand Babatunde Ololade Babatunde Ololade Babatunde Ololade Follow Joined Jul 22, 2021 • Jul 22 '21 Dropdown menu Copy link Hide Great article, thanks Collapse Expand Dan Curtis Dan Curtis Dan Curtis Follow cowboy coder Joined May 14, 2020 • Mar 28 '21 Dropdown menu Copy link Hide Thank you! I was wasting so much time flipping between developing with npm scripts and then testing with docker...hot reloading for the win! Collapse Expand jamie gilmartin jamie gilmartin jamie gilmartin Follow Joined Aug 14, 2020 • Apr 13 '21 Dropdown menu Copy link Hide This was very well done. Thanks! Collapse Expand Stéphane Lam Stéphane Lam Stéphane Lam Follow Joined Nov 5, 2021 • Nov 5 '21 Dropdown menu Copy link Hide Thank you Collapse Expand Zenb0t Zenb0t Zenb0t Follow Joined May 30, 2019 • Sep 29 '22 Dropdown menu Copy link Hide Saved me from a massive headache. Thanks a lot! Collapse Expand Lars Rye Jeppesen Lars Rye Jeppesen Lars Rye Jeppesen Follow Aspartam Junkie Location Vice City Pronouns Grand Master Joined Feb 10, 2017 • Dec 25 '22 Dropdown menu Copy link Hide Doesn't this make a production image containing all the devDependencies? That's not what we want Collapse Expand santdev404 santdev404 santdev404 Follow Joined May 12, 2021 • Mar 12 '22 Dropdown menu Copy link Hide Excellent article!! Collapse Expand monkekode monkekode monkekode Follow Joined May 3, 2022 • May 3 '22 Dropdown menu Copy link Hide So you put all of the dev dependencies, TS sources to the docker image? Aren't you supposed to specifically not do that? Collapse Expand Douglas Brandão Douglas Brandão Douglas Brandão Follow Joined Jan 12, 2022 • Jan 12 '22 • Edited on Jan 12 • Edited Dropdown menu Copy link Hide Nice work Darian, I've been struggle with this setup for so long. Will use this as template from now on! Collapse Expand Natnael Sisay Natnael Sisay Natnael Sisay Follow Am a new be developer hopping to make a life as front end developer, and love Vue a lot Location Ethiopia Work Web developer at Student Joined Mar 23, 2020 • Nov 24 '23 Dropdown menu Copy link Hide Well you just saved me hours of work, Thank you Code of Conduct • Report abuse
In order to make the production container, I had to add
--buildto the docker up command, so theup-prodMakefile entry became:docker-compose -f docker-compose.yml -f docker-compose.prod.yml up --build -dGreat article! We would need to restart the container on installing a new module right?
Thanks Ryan! Yes you would. Most of it gets cached so rebuilding after installing another package should be much faster than the initial build.
💯
Great article, thanks
Thank you! I was wasting so much time flipping between developing with npm scripts and then testing with docker...hot reloading for the win!
This was very well done. Thanks!
Thank you
Saved me from a massive headache. Thanks a lot!
Doesn't this make a production image containing all the devDependencies? That's not what we want
Excellent article!!
So you put all of the dev dependencies, TS sources to the docker image? Aren't you supposed to specifically not do that?
Nice work Darian, I've been struggle with this setup for so long.
Will use this as template from now on!
Well you just saved me hours of work, Thank you