Open-Code-Crafters / FitFlex

FitFlex is a fitness and weight loss website offering daily, structured workout plans for a set period. Users can follow day-wise exercises tailored to their goals, whether for weight loss, muscle gain, or general fitness. With a simple, user-friendly interface, FitFlex helps track progress and stay consistent throughout their fitness journey.
https://befiteveryday.netlify.app
MIT License
56 stars 93 forks source link

[Feature Request]: create a more storage-efficient multistage Dockerfile for production deployment, #167

Open Arnab7456 opened 1 week ago

Arnab7456 commented 1 week ago

Is there an existing issue for this?

Feature Description

  1. Minimize the Production Image: The final stage uses a smaller node:14-alpine image to reduce the storage overhead. The builder stage uses the full node:14 image for installing development dependencies and building the app.

Use Case

Build Artifacts Transfer: The production image only copies the necessary files (node_modules and dist folder) from the build stage, keeping the production image light.

Optimized Layers: By separating dependencies installation (npm install) and application code copying, Docker can cache dependencies unless package.json or package-lock.json changes, speeding up the build process.

Benefits

Storage Savings: The large node:14 image (which includes build tools and extra packages) is only used during the build process. The final image uses a much smaller Alpine-based image, saving storage space for deployment.

Add ScreenShots

I'm working on it and will make a pull request as soon as possible.

Priority

High

Record

Arnab7456 commented 1 week ago

@jeevan10017 please assign it to me