Add Watchtower for automatic Docker updates

This commit is contained in:
Khoa.vo 2025-12-19 21:22:10 +07:00
parent 37394f27e7
commit dcf30ae3a5
2 changed files with 20 additions and 2 deletions

View file

@ -1,4 +1,5 @@
[ [
"nhythanh_04", "nhythanh_04",
"po.trann77" "po.trann77",
"tieu_hy26"
] ]

View file

@ -17,7 +17,6 @@ services:
- CACHE_TTL_HOURS=24 - CACHE_TTL_HOURS=24
- ADMIN_PASSWORD=admin123 # Change this to your secure password - ADMIN_PASSWORD=admin123 # Change this to your secure password
shm_size: '2gb' shm_size: '2gb'
# IMPORTANT: You must link the service to the network
networks: networks:
- purestream_net - purestream_net
healthcheck: healthcheck:
@ -26,6 +25,24 @@ services:
timeout: 10s timeout: 10s
retries: 3 retries: 3
start_period: 60s start_period: 60s
labels:
- "com.centurylinklabs.watchtower.enable=true"
# Auto-updater: Checks for new images every 5 minutes
watchtower:
image: containrrr/watchtower
container_name: watchtower
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- WATCHTOWER_CLEANUP=true # Remove old images
- WATCHTOWER_POLL_INTERVAL=300 # Check every 5 minutes
- WATCHTOWER_INCLUDE_RESTARTING=true
- WATCHTOWER_ROLLING_RESTART=true # Graceful restart
- WATCHTOWER_LABEL_ENABLE=true # Only update labeled containers
networks:
- purestream_net
networks: networks:
purestream_net: purestream_net: