Docker Recipes for Node.js Development
Docker Recipes for Node.js Development
Solve common problems with simple solutions for Node.js in Docker!
About the Book
Tired of fighting Docker when you should be building Node.js in your container?
Be Insanely Productive With Docker
Write Code, Run Your Favorite Build Tools, and Never Worry About Memorizing Cryptic Commands, Again.
With the Docker Recipes for Node.js Development eBook, you'll have access to simple solutions for common problems – ready for you to use – instantly!
Don't Sweat The Details
Software development is moving quickly toward scalability through the use of many small applications with many instances each.
Tools like Docker help you encapsulate these apps and microservices. With it, you can keep application dependencies and configuration separate.
This means you may never have to face the “Work on My Machine” problem, again.
Docker is amazing – no doubt about that.
But, let's face it… The mental overhead it introduces is not insignificant.
With new code, new configuration, and new runtime environments for your development process, it can be overwhelming for even the most seasoned of developers.
Get back to building your application
With the upcoming Docker Recipes for Node.js Development ebook, you can stop worrying about memorizing configuration that you'll only touch a few times in a project's lifetime.
You don't need to waste precious brain power, wondering if you can use your favorite build tools, debugger or editor.
Instead, you can get back to solving the business needs, knowing that yes, you can continue to use your favorite tools and techniques.
Don't worry about re-typing code from a book
This ebook will give you the code and configuration to solve to the most common problems that you're facing when developing Node.js apps with Docker.
And you'll have copy-and-paste access to the source files and command-line examples, letting you quickly implement the solutions you need.
For example:
- Are you waiting more than a few seconds for npm install to finish? Recipe #4 will show you how to speed up npm when using a volume mount in a container. Cut the install time in half, and get back to coding and running your app.
- Is your container exiting before you can see the application error? Recipe #6 will show you how to start your application with the debugger already attached. Now you can find and fix thee errors that are preventing your app from starting!
- Having problems figuring out what's causing a certain bug? Recipe #7 will show you how to step into a Docker container and attach a debugger to already running code. Keep the application state intact, and find the error immediately.
- Want to use your favorite debugger, instead of the command-line? Recipe #8 gives you both Docker container and Visual Studio Code configuration, for debugging. You'll save hours of time and headache, by using your preferred tools!
The content goes far beyond just the recipe goals, as well. You'll get insight into how each step in the recipe is used, giving you additional tools to use as you see fit.
- Need to run a command other than the one your image specifies? Learn how to create a new container instance, supplying a different command to execute
- Want to run your tool in an existing container instance? Run any arbitrary tools or commands you want, in a running container.
- Looking for the “Process ID” of your running app? List all running processes, and get the PID you need.
The early release version of Docker Recipes for Node.js Development includes these recipes with additional detail, as well. It also promises to deliver a comprehensive set of Docker related code and configuration, when complete.
Docker Recipes for Node.js Development: Early Release
This book is not yet complete, but I am making it available starting now so that you can take advantage of the wealth of information already contained within.
When you purchase the early release eBook you'll get instant access to the content mentioned above and to all updates to the book as progress happens. You'll also receive the complete code for the book, as it becomes available. This will ensure you have a solid place from which you can start creating your own Docker projects for Node.js.
Who Should Read This Book
If you’re new to Docker, this book is not for you. I would recommend you start with the WatchMeCode Guide to Learning Docker if you need to learn Docker from the ground, up.
If you’re looking for a resource to show you the basics of configuring Docker to run a Node.js application, this book is not for you, either. The WatchMeCode Guide to Building Node.js Apps in Docker will show you how to configure a Docker container, run Node.js, get Express.js installed with npm install and more.
However, if you’re already using Docker, already know how to configure a basic Node.js and Express.js application in a container, but you find yourself running into difficult situations with debugging, reloading code, and running your tool set within Docker, this book is for you.
Within these recipes (chapters), you’ll find answers to the problems that plague developers beyond the basics of standing up a Docker container.
You’ll learn how to combine tools, command-line options, Dockerfile configuration items and more, into solutions for the unique problems that Node.js and JavaScript developers face when building applications within a Docker container. And you'll learn from experience in creating real-world Docker solutions for Node.js applications - not some theoretical application that could be useful somewhere.
A Solution For Developers, From A Developer
Dear developer, struggling to work with Node.js in Docker,
My name is Derick Bailey.
I'm a JavaScript and Node.js developer, like you. I write code and build applications, struggling to deal with production issues vs development needs.
I’m also a speaker and a published author. I've been writing code since 1988, have been a prolific blogger since 2004 and have been delivering world-class training to developers like yourself, through on-site classes, screencasts, ebooks and more.
I've spent a lifetime (more than 20 years) building software for leading financial organizations and airlines, the U.S. government, and more. I've created critical systems for large healthcare organizations, saving them millions of dollars a year. I've helped small-town, independently owned businesses improve their bottom line with simple software solutions and complex process automation.
And I've helped countless developers through sites like Stack Overflow, writing sample code for Microsoft's MSDN library, by publishing dozens of leading open source projects, including the most widely used add-on for Backbone.js (Marionette.js) and more.
Through my career, I have seen technologies come and go, frameworks grow and wither, and tools spring to life and die in abandon. I've also found that the core principles and patterns of software development are timeless – never dying, only changing implementation and form.
But one thing I don't see very often, is a technology so fundamentally better than what you had done in the past, that you wonder how we ever worked without it.
Docker is that level of technology.
Like the PC revolution of the 90's, the virtual machine revolution of early 2000's, or the cloud and cloud-scale, Docker is a tool set that encapsulate decades of best practices and solid fundamentals in a manner that is revolutionizing the way we work with software – both in development and in production.
But a new and growing technology is bound to have learning curves, rough edges and scenarios that are not yet developed into a collective best-practice. Docker is no exception. It can be difficult to learn and work around common problems.
Now, however, with my own experience in real-world development and debugging efforts, I want to show you just how smooth Docker can be with Node.js. I want to show you the tools, tricks and techniques that have made Docker a permanent – and simple – part of my development efforts.
With that, I present to you Docker Recipes for Node.js Development.
– Derick Bailey
– Creator of WatchMeCode.net
What Developers Say About Derick's Docker Training
“Thank you! Best docker resource I come across!” – sd
“[the Docker cheatsheet] was useful, even though I've been working with docker a while. Thanks for sharing that.” – Oliver A
“Thank you so much for this cheatsheet – it help in my start learning of docker.” – Evgeny S.
“Yes. It's very good table to remember the commands. Very useful! Cheers.” – Arthur A.
“Thank you for the tips and advice. Can't wait for more videos! keep it going! Thank you” – Fabio F.
“Thanks Derick! I liked all the docker cheatsheets with the graphic and short description it is perfect!” – S. Thomas
Bundles that include this book
Table of Contents
-
-
Preface
- Who Should Read This Book
- How This Book Is Written
- Where To Get The Code and Configuration
-
Recipe 0: Selecting A Node.js Docker Image
- Select Your Node.js Version, First
- Selecting Your Linux Distribution
- Selection: Full, Slim or Alpine?
- Recommendation: Alpine Linux
- What’s Next?
-
Preface
-
Part 1: Core Images for Node.js
-
Recipe 1: A Base Express.js Image
- The Recipe
- Cooking Instructions
- What’s Next?
-
Recipe 2: A Development Image
- The Recipe
- Cooking Instructions
- What’s Next?
-
Recipe 3: Native Build Tools
- The Recipe
- Cooking Instructions
- What’s Next?
-
Recipe 1: A Base Express.js Image
-
Part 2: Volume Mounts and Editing Code
-
Recipe 4: Editing Code with Volume Mounts
- The Recipe
- Cooking Instructions
- Bring Your Own Editor
- What’s Next?
-
Recipe 5: Speed Up
npm install
in Volume Mounts- The Recipe
- Cooking Instructions
- What’s Next?
-
Recipe 6: Cache
npm install
for Faster Startup- The Recipe
- Cooking Instructions
- What’s Next?
-
Recipe 4: Editing Code with Volume Mounts
-
Part 3: Debugging In A Container
-
Recipe 7: Start An App With The Debugger
- The Recipe
- Cooking Instructions
- What’s Next?
-
Recipe 8: Debug with VS Code
- The Recipe
- Cooking Instructions
-
Recipe 7: Start An App With The Debugger
- Part 4: Networking Containers
-
Part 5: Automating Common Tasks
-
Recipe 13: Encapsulate Command-Line Options
- The Recipe
- Cooking Instructions
- What’s Next?
-
Recipe 13: Encapsulate Command-Line Options
-
Part ##: What’s Next?
-
About Derick Bailey
- Thanks For Reading
-
About Derick Bailey
The Leanpub 60-day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
Do Well. Do Good.
Authors have earned$11,577,045writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Top Books
Recipes for Decoupling
Matthias NobackSignalR on .NET 6 - the Complete Guide
Fiodar SazanavetsLearn everything there is to learn about SignalR and how to integrate it with the latest .NET 6 and C# 10 features. Learn how to connect any type of client to SignalR, including plain WebSocket client. Learn how to build interactive applications that can communicate with each other in real time without making excessive calls.
The BDD Books - Discovery (Japanese Edition)
Gáspár Nagy, Seb Rose, and Yuya Kazamaウクライナ難民を支援 - 2022年5月末まで延長!
この本の売り上げの50%は、 https://unicef.hu/veszhelyzet-ukrajnaban と https://int.depaulcharity.org/fundraising-for-depaul-ukraine/ に寄付されます。
本書籍は、振る舞い駆動開発(Behavior Driven Development, BDD)や受け入れテスト駆動開発(Acceptance Test-Driven Development, ATDD)の発見フェーズを最大限に活用する方法を提供します。
The easiest way to learn design patterns
Fiodar SazanavetsLearn design patterns in the easiest way possible. You will no longer have to brute-force your way through each one of them while trying to figure out how it works. The book provides a unique methodology that will make your understanding of design patterns stick. It can also be used as a reference book where you can find design patterns in seconds.
Agile Testing Condensed Japanese Edition
Yuya Kazama, Janet Gregory, and Lisa CrispinJanet GregoryとLisa Crispinによる2019年9月発行の書籍『Agile Testing Condensed』の日本語翻訳版です。アジャイルにおいてどのような考えでテストを行うべきなのか簡潔に書かれています!
OpenIntro Statistics
David Diez, Christopher Barr, Mine Cetinkaya-Rundel, and OpenIntroA complete foundation for Statistics, also serving as a foundation for Data Science.
Leanpub revenue supports OpenIntro (US-based nonprofit) so we can provide free desk copies to teachers interested in using OpenIntro Statistics in the classroom and expand the project to support free textbooks in other subjects.
More resources: openintro.org.
Tech Giants in Healthcare
Dr. Bertalan MeskoThis comprehensive guide, Tech Giants in Healthcare, clarifies how and why big tech companies step into healthcare, and breaks it down from one market player to the other in what direction they are going, what tools they are using and what horizons they have in front of them.
Functional event-driven architecture: Powered by Scala 3
Gabriel VolpeExplore the event-driven architecture (EDA) in a purely functional way, mainly powered by Fs2 streams in Scala 3!
Leverage your functional programming skills by designing and writing stateless microservices that scale, powered by stateful message brokers.
CCIE Service Provider Version 4 Written and Lab Exam Comprehensive Guide
Nicholas RussoThe service provider landscape has changed rapidly over the past several years. Networking vendors are continuing to propose new standards, techniques, and procedures for overcoming new challenges while concurrently reducing costs and delivering new services. Cisco has recently updated the CCIE Service Provider track to reflect these changes; this book represents the author's personal journey in achieving that certification.
Ansible for DevOps
Jeff GeerlingAnsible is a simple, but powerful, server and configuration management tool. Learn to use Ansible effectively, whether you manage one server—or thousands.
Top Bundles
- #1
All the Books of The Medical Futurist
6 Books
We put together the most popular books from The Medical Futurist to provide a clear picture about the major trends shaping the future of medicine and healthcare. Digital health technologies, artificial intelligence, the future of 20 medical specialties, big pharma, data privacy, digital health investments and how technology giants such as Amazon... - #2
Practical FP in Scala + Functional event-driven architecture
2 Books
Practical FP in Scala (A hands-on approach) & Functional event-driven architecture, aka FEDA, (Powered by Scala 3), together as a bundle! The content of PFP in Scala is a requirement to understand FEDA so why not take advantage of this bundle!? - #3
Software Architecture for Developers: Volumes 1 & 2 - Technical leadership and communication
2 Books
"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before... - #4
CCIE Service Provider Ultimate Study Bundle
2 Books
Piotr Jablonski, Lukasz Bromirski, and Nick Russo have joined forces to deliver the only CCIE Service Provider training resource you'll ever need. This bundle contains a detailed and challenging collection of workbook labs, plus an extensively detailed technical reference guide. All of us have earned the CCIE Service Provider certification... - #6
Pattern-Oriented Memory Forensics and Malware Detection
2 Books
This training bundle for security engineers and researchers, malware and memory forensics analysts includes two accelerated training courses for Windows memory dump analysis using WinDbg. It is also useful for technical support and escalation engineers who analyze memory dumps from complex software environments and need to check for possible... - #8
Modern C++ Collection
3 Books
Get All about Modern C++C++ Standard Library, including C++20Concurrency with Modern C++, including C++20C++20Each book has about 200 complete code examples. Updates are included. When I update one of the books, you immediately get the updated bundle. You can expect significant updates to each new C++ standard (C++23, C++26, .. ) and also...