Skip to content
RED SAGSkills
easy5 pts · first answer countsdockerbuild-optimization

Ordering Dockerfile steps for caching

This Node.js Dockerfile reinstalls all dependencies on every code change, making builds slow. What is the best fix?

FROM node:22-alpine
WORKDIR /app
COPY . .
RUN npm ci
CMD ["node", "server.js"]
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions