Performance: Docker containerization
MEDIUM IMPACT
Docker containerization affects the deployment speed, startup time, and resource isolation of NestJS applications.
FROM node:18-alpine WORKDIR /app COPY package*.json ./ RUN npm install --production COPY dist ./dist CMD ["node", "dist/main.js"]
FROM node:latest WORKDIR /app COPY . . RUN npm install CMD ["npm", "run", "start"]
| Pattern | Image Size | Startup Time | Resource Usage | Verdict |
|---|---|---|---|---|
| Copy all files + latest node image | 300MB+ | 10+ seconds | High | [X] Bad |
| Alpine base + production dependencies only | 90MB | 4-5 seconds | Low | [OK] Good |