nodeshift-archived / ubi8-s2i-web-app

Apache License 2.0
26 stars 28 forks source link

Prune dev dependencies? #78

Closed mhamann closed 3 years ago

mhamann commented 3 years ago

It seems that this project is geared toward static sites or single-page apps (e.g. build the bundle, copy to output dir, serve it up).

What about apps where the server is also included? For example, I just used this to build a container that compiles an SPA into the "public" directory of an Express app, then copies the whole thing into the output directory, server and all.

In this case, it would be helpful to prune the dev dependencies to reduce the size of the container.

Any thoughts?

lholmquist commented 3 years ago

I think that is a valid use case, but for that, i think you could use the plain Node.js image, registry.access.redhat.com/ubi8/nodejs-14, which does prune the dev deps

mhamann commented 3 years ago

I switched to your recommendation and there was much less friction for my specific use case. Thanks!