Skip to main content

compose-watcher

Project description

compose-watcher

Cli that restarts you docker compose services when a file inside one of its volumes changes To use with compiled languages place the compilation step in the command field.

Example usage

  • graphql api restart when schema file changes
  • Mongoke restarts when config schema changes
  • Nodejs container restarts when the src folder changes, recompiling with tsc

Install

pip3 install compose-watcher

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 logs command, there should be always a running container

version: '3'

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

Then execute compose-watcher to watch changes

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

TODO add extension filter TODO add services names as positional arguments TODO dont block the event receiving thread when restarting

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

compose-watcher-1.1.5.tar.gz (4.4 kB view details)

Uploaded Source

File details

Details for the file compose-watcher-1.1.5.tar.gz.

File metadata

  • Download URL: compose-watcher-1.1.5.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for compose-watcher-1.1.5.tar.gz
Algorithm Hash digest
SHA256 797192612751c0855ab253be9bff4bd48bfbcd5be8c20e8821952464986733ac
MD5 bb7e9d0b3a3d6671ddf16ae3c52d4b49
BLAKE2b-256 8f1dfe4fddd771602d1b405293c82667c09728339a04d2b71ee80992700dfb8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page