-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
52 lines (49 loc) · 1.47 KB
/
Copy pathdocker-compose.yml
File metadata and controls
52 lines (49 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
version: "3.8"
services:
gantry:
image: shizunge/gantry
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- "GANTRY_NODE_NAME={{.Node.Hostname}}"
- "GANTRY_SLEEP_SECONDS=0"
deploy:
replicas: 0
placement:
constraints:
- node.role==manager
restart_policy:
condition: none
labels:
- "swarm.cronjob.enable=true"
- "swarm.cronjob.schedule=45 23 0 * * *"
- "swarm.cronjob.skip-running=true"
cronjob:
image: crazymax/swarm-cronjob:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
deploy:
placement:
constraints:
- node.role==manager
# Another service to be updated.
service_to_be_updated:
image: docker
command: ["docker", "system", "prune", "-f"]
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
deploy:
replicas: 0
placement:
constraints:
- node.role==manager
restart_policy:
condition: none
labels:
- "swarm.cronjob.enable=true"
- "swarm.cronjob.schedule=0 */5 * * * *"
- "swarm.cronjob.skip-running=false"
# Add "gantry.update.options=--replicas=0" to prevent tasks from starting after the update.
# Start the tasks via cronjob only.
# "--replicas=0" only applies to services in replicated mode, it cannot be used with services in global mode.
- "gantry.update.options=--replicas=0"