Skip to content

Latest commit

 

History

39 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

container-watch

A utility script for automatically updating and managing multiple Docker Compose projects in a monorepo. Each project resides in its own subdirectory with a docker-compose.yml file.

Features

  • ✅ Auto-redeploy services when docker-compose.yml changes.
  • ✅ Only updates services that are already running.
  • --force-all option to force pull and restart all currently running services.
  • --check-images option to detect image mismatches between running containers and docker-compose.yml, and redeploy mismatched services.
  • ✅ Git-integrated diff checking (uses git pull and compares commits).
  • ✅ Color-coded logs for easy readability.

Project Structure

The monorepo in which you want to run container-watch should have the following structure:

.
├── project1
│   └── docker-compose.yml
├── project2
│   └── docker-compose.yml
└── project3
    └── docker-compose.yml

Usage

To run container-watch in a project, run the following command from the project's root directory with the correct permissions for docker and the git repository:

./container-watch

To force a full redeploy of all docker-compose projects that are currently running, run the following command:

./container-watch --force-all

To check for image mismatches between running containers and docker-compose.yml, run the following command:

./container-watch --check-images

Options

  • --force-all: Force a full redeploy of all docker-compose projects that are currently running.
  • --check-images: Check for image mismatches between running containers and docker-compose.yml.
  • --check-all-image-ids: With --check-images, pull and compare image IDs for all tags (not only moving tags like latest).
  • --depth N: Set how many directory levels deep to search for compose files (default: 1).
  • --version: Print the current script version and exit.

Requirements

  • Docker
  • Git
  • Bash

Limitations

  • By default, only looks one directory deep for compose files. Use --depth to customize discovery depth.
  • Only supports docker-compose.yml files with a single docker-compose.yml file.
  • Image mismatch detections assumes standard docker-compose.yml formats.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

About

A bash script to make sure your docker-compose deployments containers are running the correct image.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages