title: How can I speed up node.js react startup in a Docker container
body: <p>I am running node js official image inside Docker container and I noticed that the npm start command takes a lot longer to start than when it's outside of Docker.</p>
  
  <p>Are there settings that I can change to make it run faster? Perhaps allocating more memory to the container?</p>
  
  <p>For reference I will paste relevant files below.</p>
  
  <p>Dockerfile:</p>
  
  <pre><code>FROM node:8.1
  
  WORKDIR var/www/app
  
  # Global install yarn package manager
  RUN apt-get update &amp;&amp; apt-get install -y curl apt-transport-https &amp;&amp; \
      curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - &amp;&amp; \
      echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list &amp;&amp; \
      apt-get update &amp;&amp; apt-get install -y yarn
  
  RUN npm install -g create-react-app
  </code></pre>
  
  <p>The command I use to start my container:</p>
  
  <pre><code>docker run --rm -ti \
  --link api-container:api \
  --name my-container -p 3000:3000 \
  -v $(pwd):/var/www/app nxmohamad/my-container \
  bash
  </code></pre>
  
  <p>and the start script is just <code>NODE_PATH=. react-scripts start</code></p>