dspp
v10.5.1
Published
[dspp](https://github.com/131/dspp) is a **d**ocker **s**tack **p**re**p**rocessor
Downloads
907
Readme
dspp is a docker stack preprocessor
Motivation
Complex docker stack will be composed out of dozen/hundreds of microservices, volumes, and config. Wrapping all of them in a single compose file is tedious, and lacks flexibility.
dspp allows you to split your compose file, define YAML macros/anchor, use services as metadata references, inline configuration contents, use directories as provided.
Features
- Write your Docker stack as individual YAML service files, use dspp to compile it
- Deploy an entire stack or filtered by service name
- Availability of YAML macros
- Each YAML file is parsed as a JavaScript literal: they can have embedded JS code
- Configs can be written as files, directories, bundles, embedded YAML converted to JSON on the fly, or other formats
Usage
production.yml
version: "3.3"
name: my-stack
services:
service1:
image: httpd:2.4
On the entire stack:
# interactive session
dspp production.yml
# then use "plan" and "apply" command in the interactive session
# alternatively
dspp production.yml --ir://raw --ir://run=parse --write | docker stack deploy --compose-file - my-stack
On a specific service in the stack:
# Use
dspp production.yml service1
# to work only on the specific "service1" service
See all available commands in Commands docs.
Installation instructions
# requires git, most & colordiff
apt-get install git most colordiff
npx dspp my-stack.yml
The dspp stack file: syntax and examples
The dspp stack file is classic compose file that can include / reference other ones, to compile all them in a stack.
To add configs and other native Compose Spec elements to your services, follow the same rules as the services. Split them into individual files, reference them in your dspp stack file, and redeploy.
Advanced usage
Interpolating JavaScript variables in plain YAML files
Reusable snippets with YAML macros
YAML object merging: overrides, or how to set up qa/staging/local alternate stacks