docker-roadmap icon indicating copy to clipboard operation
docker-roadmap copied to clipboard

fix : Optimized dockerfile using alpine

Open charann29 opened this issue 1 year ago • 0 comments

Dockerfile Optimization

In this commit, we have optimized our Dockerfile to decrease image size and improve overall performance. We made the following changes:

  1. Switched the base image to use node:19.6-alpine for a smaller image footprint.

  2. Set the NODE_ENV environment variable to production to ensure that only production dependencies are installed.

  3. Utilized Docker build cache to cache the npm modules, which significantly reduces the image build time.

  4. Changed the user to node for improved security.

These changes not only decrease the image size but also enhance the efficiency of our Docker image, making it more suitable for production use.

charann29 avatar Oct 14 '23 11:10 charann29