From dcf30ae3a538e37924b71756a9ad60c9d4b710ed Mon Sep 17 00:00:00 2001 From: "Khoa.vo" Date: Fri, 19 Dec 2025 21:22:10 +0700 Subject: [PATCH] Add Watchtower for automatic Docker updates --- backend/following.json | 3 ++- docker-compose.yml | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/backend/following.json b/backend/following.json index 5f2c9a3..5ea2dae 100644 --- a/backend/following.json +++ b/backend/following.json @@ -1,4 +1,5 @@ [ "nhythanh_04", - "po.trann77" + "po.trann77", + "tieu_hy26" ] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index f4a6c45..12d6664 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,6 @@ services: - CACHE_TTL_HOURS=24 - ADMIN_PASSWORD=admin123 # Change this to your secure password shm_size: '2gb' - # IMPORTANT: You must link the service to the network networks: - purestream_net healthcheck: @@ -26,6 +25,24 @@ services: timeout: 10s retries: 3 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: purestream_net: