From 4629bf255d0fc6694410a4302e0fb0a8482e2ee0 Mon Sep 17 00:00:00 2001 From: groales Date: Sun, 30 Nov 2025 12:04:53 +0100 Subject: [PATCH] Compose: usar restart unless-stopped, flags en command, schedule 03:30, cleanup y socket ro --- docker-compose.yaml | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 43c24bd..47e414a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,19 +2,24 @@ services: watchtower: image: containrrr/watchtower:latest container_name: watchtower - restart: always + restart: unless-stopped environment: - TZ=Europe/Madrid - - WATCHTOWER_CLEANUP=true - - WATCHTOWER_INCLUDE_STOPPED=false - - WATCHTOWER_SCHEDULE=0 0 3 * * * - # Notificaciones (ejemplos): - # - WATCHTOWER_NOTIFICATIONS=shoutrrr - # - WATCHTOWER_NOTIFICATION_URL=telegram://token@chatid - volumes: - - /var/run/docker.sock:/var/run/docker.sock - command: --label-enable + services: + watchtower: + image: containrrr/watchtower:latest + container_name: watchtower + restart: unless-stopped + environment: + - TZ=Europe/Madrid + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + command: + - --label-enable # Solo contenedores con label enable=true + - --cleanup # Elimina imágenes antiguas tras actualizar + - --schedule=0 30 3 * * * # Ejecuta cada día a las 03:30 + - --stop-timeout=30s # Tiempo de gracia al parar contenedores -# Etiqueta tus servicios para que watchtower los actualice: -# labels: -# - "com.centurylinklabs.watchtower.enable=true" + # Añade en cada servicio que quieras actualizar: + # labels: + # - "com.centurylinklabs.watchtower.enable=true"