Add swarm example

This commit is contained in:
CrazyMax
2020-06-17 02:22:01 +02:00
committed by CrazyMax
parent 77ce512b70
commit 2a936199ef
2 changed files with 39 additions and 0 deletions

24
.examples/swarm/diun.yml Normal file
View File

@@ -0,0 +1,24 @@
version: "3.5"
services:
diun:
image: crazymax/diun:latest
volumes:
- "./data:/data"
- "/var/run/docker.sock:/var/run/docker.sock"
environment:
- "TZ=Europe/Paris"
- "LOG_LEVEL=info"
- "LOG_JSON=false"
- "DIUN_WATCH_WORKERS=20"
- "DIUN_WATCH_SCHEDULE=*/30 * * * *"
- "DIUN_PROVIDERS_SWARM=true"
deploy:
mode: replicated
replicas: 1
labels:
- "diun.enable=true"
- "diun.watch_repo=true"
placement:
constraints:
- node.role == manager

15
.examples/swarm/nginx.yml Normal file
View File

@@ -0,0 +1,15 @@
version: "3.5"
services:
nginx:
image: nginx
ports:
- target: 80
published: 80
protocol: udp
deploy:
mode: replicated
replicas: 2
labels:
- "diun.enable=true"
- "diun.watch_repo=true"