Complete the Dockerfile to specify the base image for a Node.js app.
FROM [1]The base image node:18-alpine is a lightweight Node.js image suitable for containerizing Node.js apps.
Complete the Dockerfile to copy the package.json file into the container.
COPY [1] ./app.js or node_modules.src/package.json when the file is in the root.The package.json file is copied from the current directory to the container's working directory.
Fix the error in the Dockerfile command to install dependencies.
RUN npm [1]npm start which runs the app instead of installing.npm build which is not a standard npm command.The command npm install installs all dependencies listed in package.json.
Fill both blanks to set the working directory and copy all app files.
WORKDIR [1] COPY [2] ./
src/ when files are in root.The working directory is set to /usr/src/app, and all files from the current directory . are copied into it.
Fill all three blanks to expose port 3000, set environment variable NODE_ENV to production, and define the command to start the app.
EXPOSE [1] ENV NODE_ENV=[2] CMD ["npm", "[3]"]
npm run or other commands instead of npm start.Port 3000 is exposed, environment variable NODE_ENV is set to production, and the app is started with npm start.