Skip to content

Instantly share code, notes, and snippets.

@andrew--r
Last active December 1, 2020 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrew--r/b5f458a6aa049182943fe14eb7d65c62 to your computer and use it in GitHub Desktop.
Save andrew--r/b5f458a6aa049182943fe14eb7d65c62 to your computer and use it in GitHub Desktop.
FROM node:12.13.0-alpine
WORKDIR /usr/src/deps_dev
COPY package.json yarn.lock ./
RUN cp -r . ../deps_prod && \
yarn install --prefer-offline --frozen-lockfile --no-color && \
cd ../deps_prod && \
yarn install --production --ignore-scripts --prefer-offline --frozen-lockfile --no-color && \
yarn cache clean
@pvpshoot
Copy link

pvpshoot commented Dec 1, 2020

не увидел в списке опций --prefer-offline, только --offline. Это тоже самое?

@andrew--r
Copy link
Author

@pvpshoot странно, что на сайте не все опции описаны. yarn@1.22.5:

➜  ~ yarn install -h               

  Usage: yarn install [flags]

  Yarn install is used to install all dependencies for a project.

  Options:
    ...
    --offline                           trigger an error if any required dependencies are not available in local cache
    --prefer-offline                    use network only if dependencies are not available in local cache
    ...

@pvpshoot
Copy link

pvpshoot commented Dec 1, 2020

Спасибо ❤️

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