grammarly / rocker-compose

Docker composition tool with idempotency features for deploying apps composed of multiple containers.
Other
407 stars 26 forks source link

Watch mounted volume? #17

Closed ericclemmons closed 9 years ago

ericclemmons commented 9 years ago

First off, thank you for making something so easy & approachable!

We've avoided Docker because of the headache in setup, but I was able to:

  1. Install Docker Toolbox.
  2. Install rocker-compose.
  3. Actually get my Node app running with a single compose.yml!

Is there a way to watch for changes? I didn't see anything with rocker-compose, so if I need to look elsewhere please let me know :)

namespace: forms
containers:
  app:
    cmd: |-
      cd /var/www
      npm install
      NODE_ENV=staging npm run dev
    image: node:4.1.1
    links:
      - redis:redis
    ports:
      - "8080:8080"
      - "3000:3000"
    volumes:
      - .:/var/www

  redis:
    image: redis:3.0.4
    volumes_from:
      - redis_data

  redis_data:
    image: grammarly/scratch:latest
    state: created
    volumes:
      - /data
ybogdanov commented 9 years ago

Hi @ericclemmons. Thanks!

What do you mean by changes? You want to detect changes to the compose.yml and automatically apply them to the running containers?

ericclemmons commented 9 years ago

Whoops! Sorry that I wasn't clear before.

I meant for watching changes to the project that's been mounted in the Docker instance. (In the example, it's - .:/var/www) Like most Javascript projects, I have watchers that re-build the JS/CSS & restarts the server when the files change.

I see there have been issues with this in the past:

https://github.com/brikis98/docker-osx-dev

But I was wondering if it's something that's solvable with rocker-compose or not.

(Side question: is there a quick way to "restart" the machines, where the cmd gets re-ran? I'm just rocker-compose rm && rocker-compose runing right now, since it's pretty darn fast as it is!)

Thanks for the prompt response!

ybogdanov commented 9 years ago

Unfortunately, rocker-compose does not have any power over the "laws of physics" of VirtualBox mounts.

On your second question, there is rocker-compose run --force that is exactly the same as running rm && run. But it will also re-create your redis_data container, so be cautious.

ericclemmons commented 9 years ago

Ah, I see. Thanks!

I dunno when that problem will be solved (since, again, Docker has never made it far because of issue after issue), which seems to be a blocker for localized development for most on OS X.

Hopefully El Capitan or someone will crack that nut.

Either way, rocker-compose is pretty smooth, and the README is fantastically written.