3 ms·
yeah, that is a mistake. I just did not fully rethink my code when I moved the build layers. I will be removing that tonight along with a few changed suggested
by herohamp 6y ago
yeah, that is a mistake. I just did not fully rethink my code when I moved the build layers. I will be removing that tonight along with a few changed suggested here
- 1337shadow 6y agoOn a second thought, I also don't understand why do npm in two different images, why not just copy the webpack bundles from the builder image into the nginx image ? For me the cause of the big image size was in COPY --from=npmpackages /app /app From your third Dockerfile, it seems replacing the above with the following would have done the trick without adding an extra stage COPY --from=npmpackages /app/_site/ /usr/share/nginx/html/
- herohamp 6y agoI do npm in two different images so that the node_modules can be cached between builds. this massively speeds up my build. The npmpackages layer only installs the npm modules
- 1337shadow 6y agoI see, this speeds up when you change a dependency, because at least then your whole node_modules is not thrown away is that right ?