title: Error running grunt in docker: Fatal error: Unable to find local grunt
body: <p>I'm trying trying to run my project with all dependencies inside docker but I got stuck with grunt dependency, for some reason grunt fails with an error that it can't find local grunt.</p>
  
  <p>I created an example of how to reproduce this:</p>
  
  <pre><code>.
  ├── code
  │   ├── bower.json
  │   ├── Gruntfile.js
  │   └── package.json
  ├── docker-compose.yml
  └── frontend.dockerfile
  </code></pre>
  
  <p><strong>docker-compose.yml</strong>:</p>
  
  <pre><code>version: "2"
  services:
    frontend:
      build:
        context: .
        dockerfile: frontend.dockerfile
      ports:
        - "8585:8000"
      volumes:
        - ./code:/srv/frontend
      command: grunt
  </code></pre>
  
  <p><strong>frontend.dockerfile</strong>:</p>
  
  <pre><code>FROM node:wheezy
  
  ADD code /srv/frontend
  WORKDIR /srv/frontend
  RUN npm install -g grunt-cli bower
  RUN npm install
  
  RUN groupadd -r usergroup &amp;&amp; useradd -m -r -g usergroup user
  RUN chown -R user:usergroup /srv/frontend
  USER user
  
  RUN bower install
  </code></pre>
  
  <p><strong>bower.json</strong>:</p>
  
  <pre><code>{
    "name": "code",
    "description": "",
    "main": "index.js",
    "authors": [
      "Mr. No One"
    ],
    "license": "ISC",
    "homepage": "",
    "ignore": [
      "**/.*",
      "node_modules",
      "bower_components",
      "test",
      "tests"
    ],
    "dependencies": {
      "angular": "^1.5.8"
    }
  }
  </code></pre>
  
  <p><strong>Gruntfile.json</strong>:</p>
  
  <pre><code>module.exports = function(grunt) {
      grunt.initConfig({});
  
      // tasks
      grunt.registerTask('default', []);
  };
  </code></pre>
  
  <p><strong>package.json</strong>:</p>
  
  <pre><code>{
    "name": "code",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
      "test": "echo \"Error: no test specified\" &amp;&amp; exit 1"
    },
    "author": "",
    "license": "ISC",
    "devDependencies": {
      "grunt": "^1.0.1"
    }
  }
  </code></pre>
  
  <p><code>$ docker-compose up
  ... installing all dependencies ...
  </code>
  after installation, it fails when tries to run the <code>grunt</code> command I specified in my <code>docker-compose.yml</code> file with this error:</p>
  
  <pre><code>frontend_1  | grunt-cli: The grunt command line interface (v1.2.0)
  frontend_1  | 
  frontend_1  | Fatal error: Unable to find local grunt.
  frontend_1  | 
  frontend_1  | If you're seeing this message, grunt hasn't been installed locally to
  frontend_1  | your project. For more information about installing and configuring grunt,
  frontend_1  | please see the Getting Started guide:
  frontend_1  | 
  frontend_1  | http://gruntjs.com/getting-started
  </code></pre>
  
  <p><code>package.json</code> actually does include <code>grunt</code> as a dependency so it should be installed after <code>RUN npm install</code>.</p>