Docker: Approaches for watching files and restarting container processes

Are there any workable approaches to watch/reload within docker?

The use case here is development, where switching between branches may change one or more of backend, frontend or database provisioning files.

  • Docker multiple entrypoints
  • Intermittent Connection Errors for Docker Swarm Services
  • Conditional fig configuration for dev needs
  • Enable JMX in Tomcat docker container
  • How to run a full laravel on kubernetes?
  • Hibernate database configuration for cloud deployment
  • Example: I have a node.js application. If server JS code changes, I want the backend server to restart. If package.json changes, I want the “install” container (runs npm install, saving node_modules to a shared Volume). If SQL files change, I want the provisioning container to run its psql commands again.

    Basically, I want to watch certain files and restart the process if they change (container itself is not technically restarted). Supervisord isn’t cut out for watching, but seems like process managers like PM2 or Forever would normally be the slam dunk choice if it weren’t for the docker consideration.

  • Docker-compose is dependent on the locally installed packages outside the Docker environment
  • how to reconnect to a docker container
  • Apache Mesos - Docker container
  • cannot start docker daemon
  • external_hosts docker composer not working
  • fail to link redis container to node.js container in docker
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.