title: running commands in docker-compose
body: <p>I am trying to run two docker containers on a VPS machine that has Ubuntu 15.10 and am using <code>docker-compose</code> for this. One container is a mongodb server and the other runs my web app written in node.js/sails.js.</p>
  
  <p>I wrote the following in <code>docker-compose.yml</code> so that <code>docker-compose up</code> will run both containers. I am mounting the web app to the directory <code>/host</code> in the web app docker container and would like to do a port mapping <code>3050:1337</code> (host:docker). In order to run the web app, I used the <code>command</code> label and use bash to change directory and execute <code>sails lift</code> command, however, it does not work. I guess my following script is wrong:</p>
  
  <pre><code>MongoDB:
    image: mongo
  
  MyAPI:
    image: sailsjs-microservice:dev
    volumes:
     - /root/Code/node/My-API:/host
    command: bash -c "cd /host &amp;&amp; sails lift"
    ports:
     - "3050:1337"
  </code></pre>
  
  <p>I appreciate your help</p>