Search code examples
dockerfigdocker-compose

Docker compose environment and paths


I am trying to create local development environment using Docker Compose. I started using this example https://github.com/b00giZm/docker-compose-nodejs-examples/tree/master/03-express-gulp-watch and it is working like a charm. No problem there.

However the structure in that example is too simple and doesn't fit to my needs. I am planning to run my application with coreos on production, so I need a bunch of other config files also. This is roughly how I CHANGED the example above:

application
   app
      bin
      public
      routes
      views
      app.js
      gulpfile.js
      package.json

vm
   coreos (production configs here)
   docker (development configs here)
      app
         Dockerfile
      docker-compose.yml

Dockerfile for actual application in there, because I would like to use separate dockerfiles for production and development use.

I also changed my docker-compose.yml to this:

web:
  build: app
  volumes:
    - "../../app:/src/app"
  ports:
    - "3030:3000"
    - "35729:35729"

After this "docker-compose build" goes ok, but "docker-compose up" doesn't. I get an error saying, that gulpfile cant be found. In my logic this is because of volume mounts, they don't work with parent directories as I assume.

Any idea what I am doing wrong? Or I you have working example for this situation, please share it.


Solution

  • dnephin was right. Removing old containers did the trick. Thanks!