I'm using Docker containers to run my CRA application. I use 2 different DockerFile, one for running CRA in development and one to generate the build. During the step of installing dependencies:
FROM node:15.5.0-alpine3.10
USER node
RUN mkdir /home/node/code
WORKDIR /home/node/code
COPY package.json yarn.lock ./
RUN yarn
ENV PATH /home/node/code/node_modules/.bin:$PATH
CMD yarn start
I need to copy my updated yarn.lock file (or package-lock.json file is using NPM) back to host after the container generate the new version of the file.
I had search the solution everywhere, but I didn't find anything to resolve this problem.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…