Compose-Examples/examples/watchtower/docker-compose.yml

54 lines
1.7 KiB
YAML
Raw Normal View History

2023-02-15 22:45:31 +01:00
services:
2023-02-15 22:45:31 +01:00
watchtower:
2025-02-19 16:38:14 +01:00
image: containrrr/watchtower:latest
2023-02-15 22:45:31 +01:00
container_name: watchtower
hostname: watchtower
environment:
2024-01-14 21:04:06 +01:00
#- WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=${SMTP_PORT:-587}
#- WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER=${SMTP_USER:-smtpuser}
#- WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD=${SMTP_PASS:-smtppass}
#- WATCHTOWER_NOTIFICATION_EMAIL_FROM=${SMTP_MAIL_FROM:-watchtower@example.com}
#- WATCHTOWER_NOTIFICATION_EMAIL_TO=${SMTP_MAIL_TO:-watchtower@example.com}
#- WATCHTOWER_NOTIFICATION_EMAIL_SERVER=${SMTP_SERVER:-smtp.google.com}
#- WATCHTOWER_HTTP_API_TOKEN=${API_TOKEN:-SecureApiToken}
2023-02-15 22:45:31 +01:00
#- WATCHTOWER_NOTIFICATIONS=email
#- WATCHTOWER_MONITOR_ONLY=true
2023-02-19 14:19:15 +01:00
- WATCHTOWER_SCHEDULE=0 0 6 * * * # requires a go cron syntax of 6 space-separated fields; see https://containrrr.dev/watchtower/arguments/#scheduling
2023-02-15 22:45:31 +01:00
- WATCHTOWER_CLEANUP=true # remove unused images afterwards
2025-02-19 16:38:14 +01:00
- DOCKER_HOST=tcp://socket-proxy:2375 # use socket-proxy for secure docker api access
2023-02-15 22:45:31 +01:00
restart: always
2025-02-19 16:38:14 +01:00
networks:
- watchtower
- proxynet
2023-02-15 22:45:31 +01:00
volumes:
- /etc/localtime:/etc/localtime:ro
working_dir: /
labels:
2025-02-19 16:38:14 +01:00
com.centurylinklabs.watchtower: true
socket-proxy:
image: lscr.io/linuxserver/socket-proxy:1.26.2
container_name: socket-proxy-watchtower
environment:
- ALLOW_START=1
- ALLOW_STOP=1
- ALLOW_RESTARTS=1
- CONTAINERS=1
- IMAGES=1
- NETWORKS=1
- POST=1
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- proxynet
restart: always
read_only: true
tmpfs:
- /run
networks:
proxynet:
internal: true
watchtower: