Bird
0
0

Given this Dockerfile snippet:

medium📝 Predict Output Q4 of 15
Remix - Deployment
Given this Dockerfile snippet:
FROM node:18-alpine
WORKDIR /app
COPY . .
RUN npm install
CMD ["npm", "start"]

What happens when you build and run this container?
AThe app installs dependencies and starts with 'npm start' inside /app.
BThe container fails because 'COPY . .' is invalid syntax.
CThe app runs but without installing dependencies.
DThe container exposes port 3000 automatically.
Step-by-Step Solution
Solution:
  1. Step 1: Analyze Dockerfile commands

    It sets node image, sets /app directory, copies files, installs dependencies, and runs 'npm start'.
  2. Step 2: Check each option

    COPY syntax is valid, dependencies are installed, no port exposed automatically.
  3. Final Answer:

    The app installs dependencies and starts with 'npm start' inside /app. -> Option A
  4. Quick Check:

    Build and run = install then start [OK]
Quick Trick: COPY . . copies current folder to container [OK]
Common Mistakes:
MISTAKES
  • Thinking COPY . . is invalid
  • Assuming dependencies are skipped
  • Believing ports open automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Remix Quizzes