faradayio / cage

Develop and deploy complex Docker applications
http://cage.faraday.io
Apache License 2.0
307 stars 26 forks source link

cage watch #55

Open summer4096 opened 7 years ago

summer4096 commented 7 years ago

I propose a command that watches a mounted source and restarts the container when files change.

This would, by default, watch all files in the dir, excluding what's in .gitignore

It would also be nice to configure it to watch a given file, directory, or glob. In node apps, this configuration would probably look something like dist/**/*.js

The restart itself would probably have to be debounced because lots of file changes can happen at once.

Some containers can auto-reload their own source code, but that can be a lot of work to set up, unreliable, even dangerous in certain languages and environments.

emk commented 7 years ago

There are several general categories of things we might want to watch or monitor in a typical development session: