title: Dockerfile returns npm not found on build
body: <p>I'm really new to Docker and would like to create a container that has all my Ruby on Rails website and its dependencies in it. I read TONS of documentations and how-to's to do it but I keep struggling.</p>
  
  <p>Since I use Rubymine, there is a built-in tool that allows you to Dockerize the current project you're in from the Dockerfile you created in it. However, I keep having the error "<code>npm not found</code> while NodeJS <strong>should</strong> be installed.</p>
  
  <p>Here is my Dockerfile:</p>
  
  <pre><code>FROM ruby:2.4.3
  MAINTAINER Jaeger
  RUN apt-get update -qq &amp;&amp; apt-get install -y build-essential nodejs
  
  RUN mkdir -p /app
  WORKDIR /app
  
  COPY package.json /app
  RUN npm i -g yarn &amp;&amp; yarn
  
  COPY Gemfile Gemfile.lock ./
  RUN gem install bundler &amp;&amp; bundle install --jobs 20 --retry 5
  RUN yarn
  
  COPY . ./
  
  EXPOSE 3000
  
  CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
  </code></pre>
  
  <p>The ultimate goal should be that, since I use Webpacker and React in it (well it's a dummy project for a test, but the real website has this), I would like to install Yarn, and make Yarn install all the depencies.</p>
  
  <p>I found some other people that had the same problem but got lost trying to  understand the Docker layers concept and trying to copy some codes that didn't work either</p>