First time trying to get yarn and docker working together.
How can I stop yarn from installing the packages every single time I run docker build command?
I've found some solutions like storing node_modules in a temporary directory and then linking it, but with various packages installed I get too many errors to handle. Is there maybe a way to compare my yarn.lock with the one existing inside Docker or any other solutions?
Dockerfile:
FROM node:8.9.1-alpine
COPY package.json yarn.lock /usr/src/
RUN cd /usr/src \
&& yarn install --pure-lockfile
COPY . /usr/src
EXPOSE 3005
With this setup I get a message saying Sending build context to Docker daemon 375.2MB, then the yarn install is run as usual, fetching the packages every single time.