https://github.com/veerendra2/kompozit
Customizing Docker Compose Made Easy 🚀 (Kustomize for Docker Compose)
https://github.com/veerendra2/kompozit
configuration-management docker-compose json-patch kustomize yaml
Last synced: 3 months ago
JSON representation
Customizing Docker Compose Made Easy 🚀 (Kustomize for Docker Compose)
- Host: GitHub
- URL: https://github.com/veerendra2/kompozit
- Owner: veerendra2
- License: apache-2.0
- Created: 2024-11-20T22:46:43.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-24T17:58:13.000Z (about 1 year ago)
- Last Synced: 2025-05-24T20:18:07.092Z (8 months ago)
- Topics: configuration-management, docker-compose, json-patch, kustomize, yaml
- Language: Python
- Homepage: https://veerendra2.gitbook.io/kompozit
- Size: 24.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kompozit
[](https://hub.docker.com/r/veerendra2/kompozit) [](https://pypi.org/project/kompozit/) [](https://pypi.org/project/kompozit/) [](https://pypi.org/project/kompozit/) [](https://github.com/veerendra2/kompozit/actions/workflows/release.yml)
> ℹ Mostly likely you may want to use [Use multiple Compose files](https://docs.docker.com/compose/how-tos/multiple-compose-files/) in Docker Compose itself.
Declarative Configuration Management Tool for Docker Compose.
_Like [`kustomize.io`](https://kustomize.io/), but for [Docker Compose](https://docs.docker.com/compose/)._
## Features
Kompozit simplifies complex Docker Compose setups using declarative overlays, supporting:
- **[`patchesJSON6902`](https://datatracker.ietf.org/doc/html/rfc6902)**: Precise modifications with JSON Merge Patch.
- **[`patchesStrategicMerge`](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-api-machinery/strategic-merge-patch.md)**: Flexible hierarchical changes with Strategic Merge Patch.
## Resources
- 📖 [Documentation](https://veerendra2.gitbook.io/kompozit)
- 🛠️ [Examples](https://github.com/veerendra2/kompozit/tree/main/examples)
## But Why...? 🤔
There are scenarios where you might need different Docker Compose configurations for the same application on different machines.
- For example, I use slightly different configurations for the Traefik reverse proxy when managing my public WordPress site versus my home server. Instead of maintaining multiple, slightly different `docker-compose.yml` files for the same app, you can use kompozit to simplify and manage these variations efficiently.
Additionally, kompozit allows you to combine multiple `docker-compose.yml` files into a single stack.
- For instance, you can keep a generic `docker-compose.yml` for PostgreSQL in a central location and customize it for different stacks in other locations as needed.
## Installation 💻
### PyPi
> [https://pypi.org/project/kompozit/](https://pypi.org/project/kompozit/)
```bash
python -m pip install kompozit
kompozit -h
usage: kompozit [-h] [-b BUILD_PATH] [-o OUTPUT_DIR] [-v]
Declarative Configuration Management Tool for Docker Compose.
options:
-h, --help show this help message and exit
-b, --build BUILD_PATH
Path to a directory containing 'kompozition.yaml' or 'kompozition.yml'. (default: .)
-o, --output-dir OUTPUT_DIR
Directory to save the generated Docker Compose files. (default: None)
-v, --version Show kompozit version
```
### Docker
> [https://hub.docker.com/r/veerendra2/kompozit](https://hub.docker.com/r/veerendra2/kompozit)
```bash
docker pull veerendra2/kompozit
```
## Usage Examples ⚙️
```bash
git clone git@github.com:veerendra2/kompozit.git
cd kompozit
python -m pip install .
kompozit --build ./examples/overlay
...
# inside docker
docker pull kompozit:latest
docker run -it --rm -v ./examples:/examples kompozit:latest -b /examples/overlay
```
## Local Development 🔧
```bash
git clone git@github.com:veerendra2/kompozit.git
cd kompozit
python -m venv venv
source venv/bin/activate
pip install -e .
```