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 Exec -it bash Terminal Output Improperly Formatted [duplicate]
  • Nano and Midnight Commander don't work on Docker for Windows beta
  • PyCharm with Docker image returns “Process finished with exit code 128” on RUN command
  • Connection refused when trying to run Kong API Gateway using a docker container
  • Freeswitch with docker
  • Slow performance on Docker Containers as a Compile and Run Sandbox
  • 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.

  • Access rules between two Docker networks
  • How to stop container within itself?
  • DNS resolution with the container
  • How to execute Docker query command on all containers?
  • HTTP Call to Docker Container redirects IP to Docker ID
  • Error running commands with Dockerfile
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.