title: Docker compose not finding my index.js
body: <p>I'm following <a href="http://jdlm.info/articles/2016/03/06/lessons-building-node-app-docker.html" rel="nofollow">this guide</a> and use my low docker knowledge to get a dev environment up and running. I've hit a wall I cannot solve. This is my <code>docker-compose.yml</code>:</p>
  
  <pre><code>version: '2'
  services:
    redis:
      image: redis:3.2
    mongo:
      image: mongo:3.2
    app:
      build: .
      ports:
        - '3000:3000'
      command: './node_modules/.bin/nodemon ./index.js'
      environment:
        NODE_ENV: development
      volumes:
        - .:/home/app/cardcreator
        - /home/app/cardcreator/node_modules
      depends_on:
        - redis
        - mongo
      links:
        - redis
        - mongo
  </code></pre>
  
  <p>and this is my <code>Dockerfile</code>:</p>
  
  <pre><code>FROM node:6.3.1
  
  RUN useradd --user-group --create-home --shell /bin/false app
  
  ENV HOME=/home/app
  
  COPY package.json npm-shrinkwrap.json $HOME/cardcreator/
  RUN chown -R app:app $HOME/*
  
  USER app
  WORKDIR $HOME/cardcreator
  RUN npm install
  
  USER root
  COPY . $HOME/cardcreator/
  RUN chown -R app:app $HOME/*
  USER app
  
  CMD ["node", "index.js"]
  </code></pre>
  
  <p>When I try to start the app via <code>docker-compose up</code>, I get the error</p>
  
  <pre><code>app_1    |   Usage: nodemon [nodemon options] [script.js] [args]
  app_1    |   See "nodemon --help" for more.
  </code></pre>
  
  <p>I then removed the <code>command</code> line of my <code>docker-compose.yml</code>, only leaving <code>node index.js</code> to start. I get an error saying <code>index.js</code> cannot be found.</p>
  
  <p>The file is in my project folder, it <em>is</em> there and it has content. I can't figure out why this setup doesn't work, I did similar setups for tails and it worked fine.</p>
  
  <p>Can anyone tell me what I'm doing wrong here?</p>