A sample Dockerfile looks like this:
FROM node:12-alpine
RUN apk add --no-cache python g++ make
WORKDIR /app
COPY . .
RUN yarn install --production
CMD ["node", "src//index.js"]The first command refers to the base Docker image.
The second instruction is the RUN command, which is used to run commands in our container. In
this case we use it to do stuff like installing dependencies.
The third command is used to set the working directory in which the following commands will be executed.
The fourth command copies our source code into the container.
The fifth command installs any Node.js dependencies.
The last command is the default process that gets started when we run our container with
docker run.