All Projects β†’ remorses β†’ compose-watcher

remorses / compose-watcher

Licence: other
Watch volumes and restart services in docker compose

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to compose-watcher

Proxy Watcher
A library that recursively watches an object for mutations via Proxies and tells you which paths changed.
Stars: ✭ 35 (+29.63%)
Mutual labels:  watch, watcher
Denon
πŸ‘€ Monitor any changes in your Deno application and automatically restart.
Stars: ✭ 725 (+2585.19%)
Mutual labels:  watch, watcher
cheap-watch
If it works, why use something else? // Mirror of https://git.chor.date/Conduitry/cheap-watch
Stars: ✭ 64 (+137.04%)
Mutual labels:  watch, watcher
gowatch
watch go files for developer, support run test case and auto reload server application
Stars: ✭ 18 (-33.33%)
Mutual labels:  watch, watcher
watcher
The file system watcher that strives for perfection, with no native dependencies and optional rename detection support.
Stars: ✭ 37 (+37.04%)
Mutual labels:  watch, watcher
Multiwatch
Simple task runner on directory changes that doesn't produce tons of logs if everything is OK πŸ‘Œ
Stars: ✭ 74 (+174.07%)
Mutual labels:  watch, watcher
toxic-decorators
Library of Javascript decorators
Stars: ✭ 26 (-3.7%)
Mutual labels:  watch, watcher
Git Repo Watcher
A simple bash script to watch a git repository and pull upstream changes if needed.
Stars: ✭ 73 (+170.37%)
Mutual labels:  watch, watcher
Funzzy
Yet another fancy watcher. (Rust)
Stars: ✭ 142 (+425.93%)
Mutual labels:  watch, watcher
pwatch
Process watcher(pwatch)
Stars: ✭ 33 (+22.22%)
Mutual labels:  watch, watcher
pyenvdiff-lib
Python environment comparison tool
Stars: ✭ 23 (-14.81%)
Mutual labels:  devtools
Nightscouter
An Native iOS app for displaying Nightscout website data.
Stars: ✭ 18 (-33.33%)
Mutual labels:  watch
badgee
Browser Console Improved
Stars: ✭ 26 (-3.7%)
Mutual labels:  devtools
sapling
Sapling - A convenient way to traverse your React app in VS Code
Stars: ✭ 440 (+1529.63%)
Mutual labels:  devtools
Angular-Gulp-Boilerplate
Clean but full-featured AngularJS boilerplate using Gulp workflow and best practices
Stars: ✭ 30 (+11.11%)
Mutual labels:  watch
dart-redux-remote-devtools
Remote Devtools for Dart & Flutter
Stars: ✭ 50 (+85.19%)
Mutual labels:  devtools
portal
An api-driven, in-kernel layer 2/3 load balancer.
Stars: ✭ 101 (+274.07%)
Mutual labels:  devtools
nanobox-rails
Quickly set up a Ruby on Rails app on Nanobox, the ideal platform for developers. With Nanobox, Rails app developers can set up instant, isolated development environments that can be shared among team members. Rails apps created using Nanobox can be automatically deployed to AWS, Azure, Google Cloud, and other cloud hosts without the need for de…
Stars: ✭ 19 (-29.63%)
Mutual labels:  devtools
SwiftUI-Shimmer
Shimmer is a super-light modifier that adds a shimmering effect to any SwiftUI View, for example, to show that an operation is in progress. It works well on light and dark modes, and across iOS, macOS, tvOS and watchOS.
Stars: ✭ 168 (+522.22%)
Mutual labels:  watch
gobuild
Go 语言热编译ε·₯ε…·
Stars: ✭ 49 (+81.48%)
Mutual labels:  watcher

compose-watcher

Cli that restarts you docker compose services when a file inside one of its volumes changes.

Useful for faster developement with containers that expose behaviour based on mounted files.

Example usage

  • graphql api restart when schema file changes
  • graphql api mocks based on schema file (like this one)
  • Every container that generates code and exposes a server based on a config file
  • Nodejs container restarts when the src folder changes, recompiling with tsc
  • Mongoke restarts when config schema changes

Install

pip3 install compose-watcher
# then you can watch for changes
compose-watcher -f docker-compose.yml

Usage

Use the directories you want to track as service volumes.

Also consider using init: true in the compose service definition for faster killing of processes.

To not stop the docker-compose commands on other terminals there should be always a running container (this is a strange fact about docker-compose).

version: '3'

services:
  api:
    build: .
    command: sh -c 'tsc --incremental && node index.js'
    volumes:
      - ./src:/src

Then execute compose-watcher to watch changes.

compose-watcher -f docker-compose.yml --timeout 5

TODO add extension filter

How it works

After running the compose-watcher command all the volumes mounted on every service are tracked for change, when a change happens the service where the volume is mounted is restarted toghether with the services in the depends_on filed. Then the other services that have the restarted service as a dependency in depends_on are restarted too.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].