infrastructure/ansible/plays/services/watchtower/docker-compose.yaml

51 lines
1.7 KiB
YAML
Raw Normal View History

---
services:
update:
image: containrrr/watchtower:latest
2022-06-22 20:26:50 +02:00
container_name: Watchtower
privileged: true
environment:
DOCKER_CONFIG: /config
2022-09-25 14:55:45 +02:00
WATCHTOWER_SCHEDULE: 0 42 * * * *
WATCHTOWER_CLEANUP: 1
WATCHTOWER_ROLLING_RESTART: 1
2023-03-05 17:31:37 +01:00
WATCHTOWER_NOTIFICATION_URL: "matrix://{{ watchtower.matrix.user }}:{{ watchtower.matrix.password }}@pantalaimon:8008/?disableTLS=yes{% if watchtower.matrix.options is defined %}&{{ watchtower.matrix.options | join('&') }}{% endif%}"
2023-03-05 22:23:18 +01:00
WATCHTOWER_NOTIFICATION_REPORT: "true"
WATCHTOWER_NOTIFICATION_TEMPLATE: |
{% raw %}
{{- if .Report -}}
{{- with .Report -}}
2023-03-09 12:52:30 +01:00
{{- if ( or .Updated .Failed .Skipped ) -}}
2023-03-05 22:23:18 +01:00
{% endraw %}
Updates on {{ inventory_hostname }}{% raw %}
{{len .Scanned}} Scanned, {{len .Updated}} Updated, {{len .Failed}} Failed
{{- range .Updated}}
- {{.Name}} ({{.ImageName}}): {{.CurrentImageID.ShortID}} updated to {{.LatestImageID.ShortID}}
{{- end -}}
{{- range .Skipped}}
- {{.Name}} ({{.ImageName}}): {{.State}}: {{.Error}}
{{- end -}}
{{- range .Failed}}
- {{.Name}} ({{.ImageName}}): {{.State}}: {{.Error}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- else -}}
{% endraw %}
Updates on {{ inventory_hostname }}{% raw %}
{{range .Entries -}}{{.Message}}{{"\n"}}{{- end -}}
{{- end -}}{% endraw %}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
2023-10-05 13:07:42 +02:00
- /home/core/.docker:/config:ro
restart: always
2023-03-05 22:23:01 +01:00
networks:
- default
- pantalaimon
2023-03-05 17:31:37 +01:00
2023-03-05 22:23:01 +01:00
networks:
2023-03-05 17:31:37 +01:00
pantalaimon:
2023-03-05 22:23:01 +01:00
external: true
...