
Docker Stack Deploy
https://github.com/wez/docker-stack-deploy- Category
- Developer Tools
- Rank
- No. 1682Tools index
- Pricing
- Open Source
- Type
- TOOL
- Builder
- wez
- GitHub
- 22 stars
- Date
About
GitOps automation for plain old docker compose stack deploy, by WezTerm author Wez Furlong. Keeps your docker stacks in sync with git.
What it does
A persistent container watches a private infrastructure repository, selects Compose stacks assigned to its host, orders local dependencies, and starts them after repository changes. Stack settings map chosen KeePass fields into deployment-only environment variables, keeping those values out of per-stack environment files.
Why it's ranked here
The design is compact and easy to reason about: Git holds desired configuration, hostnames select placement, and Docker Compose performs deployment. Dependency ordering and scoped secret injection add useful discipline. However, polling, privileged Docker access, and a suspicious secrets-path mismatch make it better suited to hands-on operators than unattended critical infrastructure.
What's good
Configuration stays close to each Compose stack while allowing flexible repository organization. The deployer rejects unknown stack settings, detects duplicate names and dependency cycles, and starts stacks in topological order. Secrets are decrypted only when launching Compose and selectively exposed by stack, rather than written into each stack’s environment file.
Tradeoffs
Each host receives the Docker socket, repository credentials, and the KeePass passphrase, creating a concentrated security boundary. Changes normally wait for a five-minute polling cycle, with a container restart used for immediate deployment. Dependencies cannot cross hosts. Removing a stack requires scaling every service to zero first, waiting for deployment, then deleting its directory. Mutable bind-mounted directories can also dirty the checkout or cause permission conflicts.
How to use it well
Use it for small, operator-managed Docker hosts where Compose files already describe services and Git commits should trigger deployment. Prefer Docker volumes for mutable state and read-only repository mounts for configuration. It fits host-local dependency ordering and encrypted environment injection. It does not provide cross-host dependency orchestration or event-driven deployment.
Technical notes+
src/main.rs implements a Clap CLI with GetSecret, StackDeploy, StackStop, Run, and Bootstrap commands. src/deploy_file.rs recursively discovers stack-deploy.toml, filters by hostname, rejects unknown TOML fields, and uses petgraph for topological sorting. src/secrets.rs resolves case-insensitive KeePass paths. Dockerfile builds a musl-linked Rust binary and packages it in Alpine with Git and Docker Compose. compose.yml mounts /var/run/docker.sock and /var/lib/docker-stack-deploy. A notable inconsistency appears in docker-entrypoint.sh: it passes /app/repo/.secrets.kdbc, while the README and src/main.rs expect .secrets.kdbx, and the configured checkout resides under /var/lib/docker-stack-deploy/repo.
Observed
- License
- MIT License
- Primary language
- Rust, edition 2021
- Packaging
- Container image published at ghcr.io/wez/docker-stack-deploy
- Interface
- Command-line application with secret lookup, deploy, stop, run, and bootstrap subcommands
- Runtime platform
- x86_64 Linux musl binary packaged in an Alpine container
- Deployment dependency
- Requires Docker Compose and mounts the host Docker socket
Read from README.md, Makefile, Cargo.toml, src/main.rs, src/secrets.rs, src/deploy_file.rs, Dockerfile, LICENSE.md, compose.yml, bootstrap.sh, .rustfmt.toml, docker-entrypoint.sh, .github/FUNDING.yml, .github/workflows/build-image.yml.
What it can do
Deploy docker compose stacks from git repository
Git repository containing docker-compose.yml files → Running docker stack deployment
Synchronize docker stacks with git changes
Git repository updates and existing docker stacks → Updated docker stack deployments
Monitor git repository for changes
Git repository URL and polling configuration → Change detection notifications
Automatically update running stacks when git changes
Git commits containing stack configuration changes → Redeployed docker stacks with new configurations
Parse and validate docker-compose files from git
Docker-compose.yml files from git repository → Validated stack configuration ready for deployment
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.