Dockerfile
A plain text file containing the step-by-step instructions and commands needed to assemble a Docker image.
What it is
A Dockerfile is the blueprint for a container. It specifies the base operating system (like Ubuntu or Alpine Linux), copies your application code into the image, installs required dependencies, and defines the exact command used to start the application. The Docker engine reads this file to build a reusable image.
When you would use it
You write a Dockerfile at the root of your project when you are ready to package your application so it can be built and deployed consistently on any server.
Common operations
- Defining the exact version of Node.js required to run an application.
- Automating the installation of system-level packages needed by a backend service.