codeforhuntsville / Frontier

A civic app for finding whats near me
http://codeforhuntsville.com/
MIT License
9 stars 7 forks source link

Stole @clarkda idea for an arguably better dockerfile. #34

Closed itsamenathan closed 9 years ago

itsamenathan commented 9 years ago

npm install is done separately and copy to working dir. This way rebuilds are much faster.

chadxz commented 9 years ago

This looks good. I was reading an article just a few days ago that described this process. One downside to doing it this way is that you don't automatically get package upgrades when you build your image, but that could also be seen as an upside ;) If we ever wanna update the packages that are stored within the image, we can just run the docker build process with cache disabled.

:+1:

chadxz commented 9 years ago

we still need to make sure that node_modules is not copied from the source repo if the person is building the docker image after they have already run npm install. But that is recorded in #21 and can be fixed in a separate PR

chadxz commented 9 years ago

@itsamenathan I invited you to the org. You can merge this yourself :wink:

dustywusty commented 9 years ago

@itsamenathan add a .dockerignore file with node_modules

chadxz commented 9 years ago

this PR will close #21 now too, then. Thanks @itsamenathan :+1:

chadxz commented 9 years ago

well, i say that, but I think "running npm as root" is still an issue. Probably best to leave #21 open till we address that one way or the other.