Complete the code to specify the base image for building a Vue app in Docker.
FROM node:[1]The Dockerfile starts with a Node.js base image. Using version 18 ensures compatibility with Vue 3 and modern tools.
Complete the code to copy the package.json file into the Docker image.
COPY [1] ./We copy package.json to install dependencies inside the Docker image.
Fix the error in the Dockerfile command to build the Vue app.
RUN npm [1]npm start which runs the dev server, not build.npm install which only installs dependencies.The command npm run build compiles the Vue app into static files for production.
Fill both blanks to serve the built Vue app using Nginx in Docker.
FROM nginx:[1] COPY [2] /usr/share/nginx/html
We use the lightweight nginx:alpine image and copy the dist folder with built files to serve the app.
Fill both blanks to expose port and run the Nginx server in Docker.
EXPOSE [1] CMD ["nginx", "-g", "[2]"]
Port 80 is exposed for HTTP traffic. The command runs Nginx in the foreground with daemon off;.