grafana-image-renderer icon indicating copy to clipboard operation
grafana-image-renderer copied to clipboard

Do not install dev dependencies inside Docker container

Open alkuzad opened this issue 2 years ago • 4 comments

What would you like to be added:

Do not install devDependencies into Docker container

Why is this needed:

Dev dependencies produce security issues and needs to be upgraded but are more likely to be skipped.

These dependencies are now problematic: https://github.com/advisories/GHSA-wpg7-2c88-r8xv https://github.com/advisories/GHSA-mhxj-85r3-2x55

alkuzad avatar Jul 27 '22 13:07 alkuzad

Hi @alkuzad,

Thanks for your request. At first glance, I agree it makes sense to do not install devDependencies inside the Docker container or, at least, to do multi-stage builds to do not include them in the final image.

We'll take a look at possible improvements in that way and will reach you back with any update, thanks!

joanlopez avatar Sep 12 '22 09:09 joanlopez

Hey,

I looked again into the Dockerfile and it seems it'd be enough with just adding ENV NODE_ENV=production or --production=true at time of installing the dependencies (yarn install).

Would that make sense for you @alkuzad? Do you think that would be enough? Anything else?

Thanks!

PS: cc/ @ArturWierzbicki because I think you have more experience than me with Node apps, so you could confirm as well. Appreciated!

joanlopez avatar Nov 23 '22 10:11 joanlopez

@joanlopez yep, docs says that is the flag that disables devDependencies.

alkuzad avatar Nov 23 '22 11:11 alkuzad