cortesi / modd

A flexible developer tool that runs processes and responds to filesystem changes
MIT License
2.79k stars 130 forks source link

Daemons do not restart when running modd in a Docker container. #56

Open joosto opened 6 years ago

joosto commented 6 years ago

I am using modd to rebuild and run a binary when .go files have changed. All works well when I run modd on my host OS, but when I run modd in a Docker container, the daemon as defined in my modd.conf does not restart. It hangs on >> sending signal hangup. Changing the signal to sigterm or sigquit, etc. does not work.

My modd.conf looks like this:

**/*.go {
  prep: make install
  daemon: web-service
}

Do you have any idea what is going on here?

cortesi commented 6 years ago

I'd need information to be sure what's going on here. I did, however, just revamp process management and signalling in a way that closes some corner cases. Could you please install the repo master and confirm that you are still seeing issues?

brikou commented 5 years ago

I think this is related to docker itself, see https://forums.docker.com/t/file-system-watch-does-not-work-with-mounted-volumes/12038/13

tammersaleh commented 5 years ago

I'm experiencing the same thing on macos. Is there a good workaround?

brikou commented 5 years ago

Mounting a single file (like main.go) prevent watcher from working. You need to mount the whole dir, don't know if related to docker or modd itself.

    volumes:
      # - ./services/golang/main.go:/srv/main.go:ro # prevent watcher from working
      - ./services/golang:/srv:ro # works as expected
21888 commented 2 years ago

Do YOU need to set permissions?