Skip to content

Commit

Permalink
Add example for extensive label usage (Closes: #106)
Browse files Browse the repository at this point in the history
  • Loading branch information
moschlar committed Nov 20, 2023
1 parent a4b7a4e commit a506c97
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions examples/docker-compose.labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: "3"

services:
shepherd:
image: containrrr/shepherd
environment:
# Beware YAML gotchas regarding quoting:
# With KEY: 'VALUE', quotes are part of yaml syntax and thus get stripped
# but with KEY='VALUE', they are part of the value and stay there,
# causing problems!
SLEEP_TIME: "1d"
TZ: "US/Eastern"
VERBOSE: "true"
IGNORELIST_SERVICES: "label=shepherd.autodeploy=false"
FILTER_SERVICES: "label=shepherd.autodeploy=true"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
deploy:
placement:
constraints:
- node.role == manager

# Explicitly enable shepherd for this service
updating-app:
image: hello-world
deploy:
labels:
- shepherd.autodeploy=true

# Explicitly disable shepherd for this service
not-updating-app:
image: hello-world
deploy:
labels:
- shepherd.autodeploy=false

# Implicitly disable shepherd for this service
# because of FILTER_SERVICES above
another-not-updating-app:
image: hello-world

1 comment on commit a506c97

@Leopere
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You rock thanks!

Please sign in to comment.