Decreasing Node.js Docker image size by 90%

From Logic Wiki
Jump to: navigation, search


With the npm ci --only=production command a small optimization in place.

Optimize Docker image size

# Instead of using the full 930MB via 'FROM node:12'
# Use the alpine image
FROM node:12-alpine 
# OR
# Use the slim image
FROM node:12-slim

Alpine is the smallest one