# Watchtower - Container update notifier for Calypso (schedule disabled - GitOps managed)
# Auto-update schedule removed; image updates are handled via Renovate PRs.
# Manual update trigger: POST http://localhost:8080/v1/update
#   Header: Authorization: Bearer watchtower-metrics-token

version: '3.8'

services:
  watchtower:
    image: containrrr/watchtower:latest
    container_name: watchtower
    ports:
      - "8080:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      # Core functionality
      - DOCKER_API_VERSION=1.43
      - WATCHTOWER_CLEANUP=true
      - WATCHTOWER_INCLUDE_RESTARTING=true
      - WATCHTOWER_INCLUDE_STOPPED=true
      - WATCHTOWER_REVIVE_STOPPED=false
      - WATCHTOWER_TIMEOUT=10s
      - TZ=America/Los_Angeles

      # Schedule disabled — updates managed via Renovate PRs (GitOps).
      # Enable manual HTTP API updates instead.
      - WATCHTOWER_HTTP_API_UPDATE=true

      # HTTP API for metrics and manual update triggers
      - WATCHTOWER_HTTP_API_METRICS=true
      - WATCHTOWER_HTTP_API_TOKEN="REDACTED_HTTP_TOKEN"

    restart: unless-stopped
    labels:
      # Exclude watchtower from updating itself
      - "com.centurylinklabs.watchtower.enable=false"
