We're a place where coders share, stay up-to-date and grow their careers.
I have learnt this for a while, but just to recap.
Run npm ci or yarn --frozen-lockfile inside Dockerfile, but before that, don't forget to copy lock-file.
npm ci
yarn --frozen-lockfile
Dockerfile
COPY package.json yarn.lock ./ RUN yarn --production --frozen-lockfile
And, I also noticed that Yarn is already installed by default in the Docker image, no need to apk add yarn.
apk add yarn
Awesome!
I have learnt this for a while, but just to recap.
Run
npm ci
oryarn --frozen-lockfile
insideDockerfile
, but before that, don't forget to copy lock-file.And, I also noticed that Yarn is already installed by default in the Docker image, no need to
apk add yarn
.Awesome!