Complete the Dockerfile to set the base image for a Svelte app.
FROM [1]The base image node:18-alpine is lightweight and suitable for building Svelte apps.
Complete the command to install dependencies in the Dockerfile.
RUN npm [1]npm start instead of install will not install packages.npm build is not a valid npm command.npm install installs all dependencies listed in package.json.
Fix the error in the Dockerfile command to build the Svelte app.
RUN npm run [1]start runs the app instead of building it.install installs packages but does not build.The build script compiles the Svelte app for production.
Fill both blanks to copy the build output and expose the correct port.
COPY public [1] EXPOSE [2]
The build files are copied to Nginx's default directory /usr/share/nginx/html, and port 80 is exposed for HTTP traffic.
Fill all three blanks to complete the multi-stage Dockerfile for Svelte deployment.
FROM node:18-alpine as builder WORKDIR /app COPY package.json package-lock.json ./ RUN npm [1] COPY . . RUN npm run [2] FROM nginx:stable-alpine COPY --from=builder /app/[3] /usr/share/nginx/html EXPOSE 80
First, dependencies are installed with npm install. Then the app is built with npm run build. Finally, the build output in the public folder is copied to Nginx's serving directory.