Nipu Chakraborty
Posted on September 2, 2023
1. Always use specific version
❌ Don't do this
FROM node
✅ Do this because it will ensure your container image version
FROM node:20.0.0
2. Try to use alpine version
❌ Don't do this because It can be use large
FROM node:20.0.0
✅ Do this for small official image
FROM node:20.0.0-alpine
3. Dont install all dependencies
❌ Don't do this
RUN npm install
✅ Do this because you don't need dev dependencies in your production server
RUN npm install --production
4. Mantain versioning
❌ Don't do this
docker build -t myapp .
✅ Do this it will help you to track version of your container images.
docker build -t myapp:1.0 .
💖 💪 🙅 🚩
Nipu Chakraborty
Posted on September 2, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.