-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Dockerfile more efficient for caching and add yarn #73
Conversation
@noeljackson - I swapped yarn for npm's Do you know if those legacy issues have been solved in yarn? |
@leebenson Yes, these have been fixed over here: yarnpkg/yarn#800 :) |
In my personal tests, npm 5.x is actually faster and gives better results than yarn. |
My perception was that it’s useful enough to a lot of people, that you
could easily include it on the Dockerfile to enable easy development with
npm or yarn.
If we need to rip it out, that’s fine.
The most important part of the Dockerfile is the separation of operations.
Caching is important.
|
Please re-commit without yarn. That keeps consistency with the project's 'package-lock.json' |
@noeljackson - after inspecting this some more, one issue with your So it solves caching, but the image is much bigger. So it's a toss-up between which is more important to your build environment. |
I'll play about with the Dockerfile later and attempt to optimise for caching, whilst keeping the size pretty low. |
@leebenson There are some other issues as well, when using the current and the proposed Dockerfile in production, though I've fixed those. I will tinker and see what's the best I can come up with. Cheers. |
Thanks @noeljackson. |
I've updated the Dockerfile to split up package installation and removal, as well as decreasing build times, by having npm install cached separately, then copied over. This Dockerfile allows docker-compose to work more efficiently as well. I installed yarn for increased speed and also to allow development work to take place if using
docker run -it
for example.