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