modd icon indicating copy to clipboard operation
modd copied to clipboard

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

Open joosto opened this issue 5 years ago • 5 comments

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?

joosto avatar Jul 17 '18 14:07 joosto

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?

cortesi avatar Jul 21 '18 20:07 cortesi

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

brikou avatar Oct 08 '18 10:10 brikou

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

tammersaleh avatar Jun 05 '19 16:06 tammersaleh

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

brikou avatar Aug 05 '19 13:08 brikou

Do YOU need to set permissions?

21888 avatar Jul 11 '22 22:07 21888