Complete the code to specify the base image for a NestJS Docker container.
FROM [1]The base image node:18-alpine is a lightweight Node.js image suitable for NestJS apps.
Complete the code to copy the NestJS application files into the Docker image.
COPY [1] /appCopying . copies all files from the current directory into the image's /app folder.
Fix the error in the Dockerfile command to install dependencies.
RUN npm [1]npm start which runs the app, not installs packages.npm build which is not a valid npm command.The command npm install installs all dependencies listed in package.json.
Fill both blanks to expose the correct port and set the working directory.
WORKDIR [1] EXPOSE [2]
The working directory is set to /app where the app files are copied. NestJS default port is 3000.
Fill all three blanks to run the NestJS app in production mode.
CMD ["npm", "[1]", "[2]", "[3]"]
npm start without run keyword.test instead of prod for production.The command npm run start prod starts the NestJS app in production mode.