Skip to content
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

Dockerfile - should npm ci be used? #100

Open
jameswragg opened this issue Dec 4, 2023 · 3 comments
Open

Dockerfile - should npm ci be used? #100

jameswragg opened this issue Dec 4, 2023 · 3 comments

Comments

@jameswragg
Copy link

jameswragg commented Dec 4, 2023

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?

@jameswragg jameswragg changed the title Dockerfile - should npm i here be npm ci? Dockerfile - should npm ci be used? Dec 4, 2023
@devinivy
Copy link
Member

devinivy commented Dec 7, 2023

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

@Nargonath
Copy link
Member

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.

@Nargonath
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants