-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.watcher.yml
37 lines (37 loc) · 1.65 KB
/
docker-compose.watcher.yml
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
services:
watchtower:
image: containrrr/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock # So that Watchtower can update other containers
- $HOME/.docker/config.json:/config.json # Get Docker Hub credentials from here
command: --include-stopped --revive-stopped impresso-middle-layer impresso-user-admin impresso-frontend impresso-middle-layer-public impresso-celery impresso-recsys impresso-datalab impresso-iiif-widget
restart: always
environment:
WATCHTOWER_POLL_INTERVAL: 300 # Check every 5 minutes
WATCHTOWER_CLEANUP: true # remove old images after updating
WATCHTOWER_NOTIFICATION_URL: ${WEBHOOK_URL}
WATCHTOWER_NOTIFICATION_REPORT: "true"
WATCHTOWER_NOTIFICATION_TEMPLATE: >
{{- if .Report -}}
{{- with .Report -}}
{{- if ( or .Updated .Failed ) -}}
{{len .Scanned}} Scanned, {{len .Updated}} Updated, {{len .Failed}} Failed
{{- range .Updated}}
- {{.Name}} ({{.ImageName}}): {{.CurrentImageID.ShortID}} updated to {{.LatestImageID.ShortID}}
{{- end -}}
{{- range .Failed}}
- {{.Name}} ({{.ImageName}}): {{.State}}: {{.Error}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
# Restart unhealthy containers (combined with healthcheck policies in docker-compose.yml)
autoheal:
image: willfarrell/autoheal:latest
tty: true
container_name: autoheal
restart: unless-stopped
environment:
- AUTOHEAL_CONTAINER_LABEL=all
volumes:
- /var/run/docker.sock:/var/run/docker.sock