instruction: Create a Dockerfile for Node.js with production best practices
output: ```dockerfile
  from previous builds and skipping unnecessary work.
  In order to maximize cache usage and avoid resource-intensive and time-consuming rebuilds, it's important to understand how cache invalidation works.
  Here are a few examples of situations that can cause cache to be invalidated:Any changes to the command of a RUN instruction invalidates that layer. Docker detects the change and invalidates the build cache if there's any modification to a RUN command in your Dockerfile.Any changes to files copied into the image with the COPY or ADD instructions. Docker keeps an eye on any alterations to files within your project directory. Whether it's a change in content or properties like permissions, Docker considers these modifications as triggers to invalidate the cache.Once one layer is invalidated, all following layers are also invalidated. If any previous layer, including the base image or intermediary layers, has been invalidated due to changes, Docker ensures that subsequent layers relying on it are also invalidated. This keeps the build process synchronized and prevents inconsistencies.When you're writing or editing a Dockerfile, keep an eye out for unnecessary cache misses to ensure that builds run as fast and efficiently as possible.Try it outIn this hands-on guide, you will learn how to use the Docker build cache effectively for a Node.js application.Build the applicationDownload and install Docker Desktop.Open a terminal and clone this sample application.
  
  $ git clone https://github.com/dockersamples/todo-list-app
  Navigate into the todo-list-app directory:
  
  $ cd todo-list-app
  Inside this directory, you'll find a file named Dockerfile with the following content:
  ```