https://github.com/IITC-College/express-js-app
Learning Goals
- Learn how to install only runtime dependencies inside Docker images
- Understand the difference between:
dependencies
devDependencies
- Reduce:
- image size
- installation time
- attack surface
Part 1 — Inspect Current Dependencies
Scenario
By default:
npm ci
installs everything:
- production dependencies
- development dependencies
This includes tools that are not needed in production containers.
Examples:
- Jest
- TypeScript
- ESLint
- Testing libraries