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.
- ✅ Auto-redeploy services when
docker-compose.ymlchanges. - ✅ Only updates services that are already running.
- ✅
--force-alloption to force pull and restart all currently running services. - ✅
--check-imagesoption to detect image mismatches between running containers anddocker-compose.yml, and redeploy mismatched services. - ✅ Git-integrated diff checking (uses
git pulland compares commits). - ✅ Color-coded logs for easy readability.
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
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-watchTo force a full redeploy of all docker-compose projects that are currently running, run the following command:
./container-watch --force-allTo check for image mismatches between running containers and docker-compose.yml, run the following command:
./container-watch --check-images--force-all: Force a full redeploy of all docker-compose projects that are currently running.--check-images: Check for image mismatches between running containers anddocker-compose.yml.--check-all-image-ids: With--check-images, pull and compare image IDs for all tags (not only moving tags likelatest).--depth N: Set how many directory levels deep to search for compose files (default:1).--version: Print the current script version and exit.
- Docker
- Git
- Bash
- By default, only looks one directory deep for compose files. Use
--depthto customize discovery depth. - Only supports
docker-compose.ymlfiles with a singledocker-compose.ymlfile. - Image mismatch detections assumes standard
docker-compose.ymlformats.
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.