docker-roadmap
docker-roadmap copied to clipboard
fix : Optimized dockerfile using alpine
Dockerfile Optimization
In this commit, we have optimized our Dockerfile to decrease image size and improve overall performance. We made the following changes:
-
Switched the base image to use
node:19.6-alpine
for a smaller image footprint. -
Set the
NODE_ENV
environment variable toproduction
to ensure that only production dependencies are installed. -
Utilized Docker build cache to cache the npm modules, which significantly reduces the image build time.
-
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.