title: How to update dependencies version (e.g react) in package.json if using docker
body: <p>I'am trying to use webpack + reactjs to run a project. here are the main files:</p>
  <pre><code># docker-compose.yaml
  web:
    build: .
    ports:
    - &quot;3000:3000&quot;
    volumes:
    - .:/usr/app/selina-server:rw
    environment:
    - NODE_ENV=dev
    command: &gt;
      sh -c '
        if test -d node_modules; 
        then 
          echo node_modules_exists ; 
        else 
          cp -a /tmp/node_modules /usr/app/selina-server; 
        fi &amp;&amp; 
        npm install &amp;&amp; 
        /usr/local/bin/node ./index.js
      '
  </code></pre>
  <p>Dockerfile</p>
  <pre><code>FROM node:latest
  
  WORKDIR &quot;/tmp&quot;
  
  COPY [&quot;package.json&quot;, &quot;yarn.lock*&quot;, &quot;./&quot;]
  
  RUN [&quot;yarn&quot;]
  
  WORKDIR &quot;/usr/app/selina-server&quot;
  
  RUN [&quot;ln&quot;, &quot;-s&quot;, &quot;/tmp/node_modules&quot;]
  
  COPY [&quot;.&quot;, &quot;./&quot;]
  
  RUN [&quot;yarn&quot;, &quot;run&quot;, &quot;build&quot;]
  
  EXPOSE 3000
  
  CMD [&quot;yarn&quot;, &quot;start&quot;]
  </code></pre>
  <p>package.json</p>
  <pre><code>{
    &quot;name&quot;: &quot;sample-docker-webpack&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;description&quot;: &quot;&quot;,
    &quot;main&quot;: &quot;index.js&quot;,
    &quot;scripts&quot;: {
      &quot;dev&quot;: &quot;node index.js&quot;,
      &quot;start&quot;: &quot;NODE_ENV=production node index.js&quot;,
      &quot;build&quot;: &quot;webpack&quot;
    },
    &quot;repository&quot;: {
      &quot;type&quot;: &quot;git&quot;,
      &quot;url&quot;: &quot;git+https://github.com/Andyccs/sample-docker-webpack.git&quot;
    },
    &quot;author&quot;: &quot;Andyccs&quot;,
    &quot;license&quot;: &quot;MIT&quot;,
    &quot;bugs&quot;: {
      &quot;url&quot;: &quot;https://github.com/Andyccs/sample-docker-webpack/issues&quot;
    },
    &quot;homepage&quot;: &quot;https://github.com/Andyccs/sample-docker-webpack&quot;,
    &quot;devDependencies&quot;: {
      &quot;babel-core&quot;: &quot;^6.3.26&quot;,
      &quot;babel-loader&quot;: &quot;^6.2.0&quot;,
      &quot;babel-preset-es2015&quot;: &quot;^6.3.13&quot;,
      &quot;babel-preset-react&quot;: &quot;^6.3.13&quot;,
      &quot;babel-register&quot;: &quot;^6.3.13&quot;,
      &quot;file-loader&quot;: &quot;^0.8.5&quot;,
      &quot;react-hot-loader&quot;: &quot;^1.3.0&quot;,
      &quot;webpack&quot;: &quot;^1.12.9&quot;,
      &quot;webpack-dev-middleware&quot;: &quot;^1.4.0&quot;,
      &quot;webpack-dev-server&quot;: &quot;^1.14.0&quot;,
      &quot;webpack-hot-middleware&quot;: &quot;^2.6.0&quot;
    },
    &quot;dependencies&quot;: {
      &quot;babel-preset-es2015&quot;: &quot;^6.3.13&quot;,
      &quot;babel-register&quot;: &quot;^6.3.13&quot;,
      &quot;express&quot;: &quot;^4.13.3&quot;,
      &quot;react&quot;: &quot;^0.14.5&quot;
    }
  }
  </code></pre>
  <p>what i need to do (add command &quot;npm update&quot; in docker file?) if i want to update dependencies version in package.json?</p>