services:
  watchtower:
    image: containrrr/watchtower
    container_name: watchtower
    restart: unless-stopped
    env_file: .env
    environment:
      - DOCKER_API_VERSION=1.44
      - TZ=America/New_York
      - PUID:=1000 # Reference PUID from .env
      - PGID=1000 # Reference PGID from .env
      - WATCHTOWER_CLEANUP=true
      - WATCHTOWER_INCLUDE_RESTARTING=true
      - WATCHTOWER_ROLLING_RESTARTING=true
      - WATCHTOWER_SCHEDULE=0 0 4 * * *
      - WATCHTOWER_INCLUDE_STOPPED=true
      - WATCHTOWER_NOTIFICATIONS=email
      - WATCHTOWER_NOTIFICATIONS_HOSTNAME=Docker-Deployment  # Add Server Name or IP Address
      - WATCHTOWER_NOTIFICATION_EMAIL_FROM=miker@mmcfetridge.net
      - WATCHTOWER_NOTIFICATION_EMAIL_TO=miker@mmcfetridge.net
      - WATCHTOWER_NOTIFICATION_EMAIL_SERVER=mail.mmcfetridge.net
      - WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=465
      - WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER=miker@mmcfetridge.net
      - WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD=!Sucyetat123
      - WATCHTOWER_NOTIFICATION_EMAIL_DELAY=2
    security_opt:
      - no-new-privileges:true
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock
    networks:
      - external
networks:
  external:
    external: true    # Tells Compose not to create this network.