hapipal/boilerplate

Dockerfile - should `npm ci` be used?

Opened this issue · 3 comments

Referring to the following line:

npm provides the npm ci command to install the versions specified in the package-lock.json. If your container is being built by CI & test are run with it, I believe you'd want the same versions as those running locally so should the command be npm ci here?

Yes, that seems right! Will leave this issue open until that's settled.

As I mentioned on Discord on this previous topic, I believe it'd be a nice addition. You could also leverage multi-steps Docker image if you'd want to use npm i for dev and npm ci for prod. The problem would be that you'll be installing the dependencies two times when building for prod which might not be ideal. It's probably better to only use npm ci.

@jameswragg in case we move forward with this, do you wan to make the PR?