DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
DevOps & Deployment Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
easy
DevOps & Deployment
Why should `COPY package.json ./` and `RUN npm install` be placed before `COPY . .` in a Dockerfile?
A
Because Node requires lockfiles to compile JavaScript
B
To leverage Docker's layer caching, preventing slow dependency installs on every subsequent application code update
C
To encrypt local environment variables
D
Because root users forbid post-copy scripts
Check Answer