How to Reduce Node.js Docker Image Size?

I had a web application which is written in Node.js and I wanted to dockerize it. So went to the Node.js official site and found Dockerizing a Node.js web app article. I created the Dockerfile as it says in the article. Then I built the docker image with docker build, the created image size was 1.09GB Dockerfile which produce 1.09GB docker image FROM node:18 # Create app directory WORKDIR /usr/src/app # Install app dependencies # A wildcard is used to ensure both package....

August 30, 2023 · 4 min · 646 words · CodeGenos