title: Lift Sails inside Docker container
body: <p>I know there are multiple examples (actually only a few) out there, and I've looked into some and tried to apply them to my case but then when I try to lift the container (<code>docker-compose up</code>) I end up with more or less the same error every time.</p>
  
  <p>My folder structure is:</p>
  
  <pre><code>sails-project
  --app
  ----api
  ----config
  ----node_modules
  ----.sailsrc
  ----app.js
  ----package.json
  
  --docker-compose.yml
  --Dockerfile
  </code></pre>
  
  <p>The <code>docker-compose.yml</code> file: </p>
  
  <pre><code>sails:
    build: .
    ports:
      - "8001:80"
    links:
      - postgres
    volumes:
      - ./app:/app
    environment:
      - NODE_ENV=development
    command: node app
  
  postgres:
      image: postgres:latest
      ports:
        - "8002:5432"
  </code></pre>
  
  <p>And the <code>Dockerfile</code>:</p>
  
  <pre><code>FROM node:0.12.3
  
  RUN mkdir /app
  
  WORKDIR /app
  
  # the dependencies are already installed in the local copy of the project, so 
  # they will be copied to the container
  ADD app /app
  
  CMD ["/app/app.js", "--no-daemon"]
  
  RUN cd /app; npm i
  </code></pre>
  
  <p>I tried also having <code>RUN npm i -g sails</code> instead (in the <code>Dockerfile</code>) and <code>command:sails lift</code>, but I'm getting:</p>
  
  <p><a href="https://i.stack.imgur.com/PdM3j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PdM3j.png" alt="enter image description here"></a></p>
  
  <p>Naturally, I tried different configurations of the <code>Dockerfile</code> and then with different commands (<code>node app</code>, <code>sails lift</code>, <code>npm start</code>, etc...), but constantly ending up with the same error. Any ideas?</p>