Compose GitOps is a tool designed to automate the deployment and synchronization of Docker Compose-based applications from multiple Git repositories. It leverages Docker Compose for managing multi-container Docker applications and Git for version control. This tool is especially useful for orchestrating deployments in a GitOps workflow.
Before using Compose GitOps, ensure that you have the following prerequisites installed:
See Compose GitOps in action:
To quickly set up Compose GitOps, follow these steps:
curl
:
curl -o docker-compose.yaml https://raw.githubusercontent.com/r3d-shadow/compose-gitops/main/docker-compose.yaml
This command retrieves the latest docker-compose.yml
file from the repository.docker-compose.yml
file:
repositories.yaml
file is mounted appropriately.volumes:
- ~/.docker/config.json:/root/.docker/config.json:ro
repositories.yaml
file:
repositories.yaml
:repositories:
- name: "HelloWorld App"
source:
repoURL: "github.com/r3d-shadow/helloworld.git" # without scheme
branch: "main"
composePath: "utils/deploy/docker-compose.yaml"
authentication:
method: "oauth2"
token: "GITHUB_TOKEN"
hooks:
preDeploy: |
echo "Running pre-deploy actions for HelloWorld App"
postDeploy: |
echo "Running post-deploy actions for HelloWorld App"
docker-compose up -d
This command launches the Compose GitOps service in the background, configured based on your adjusted docker-compose.yml
and repositories.yaml
files.repositories.yaml
File Change Detection and Auto-Update
repositories.yaml
file and automatically update the configurations without manual intervention.repositories.yaml
file.repositories.yaml
file.