Skip to content

Watchtower

Docker Pulls GitHub Stars Compose Templates

Description

Watchtower can update the running version of your containerized app simply by pushing a new image to the Docker Hub or your own image registry. Watchtower will pull down your new image, gracefully shut down your existing container and restart it with the same options that were used when it was deployed initially.

Install/Setup

Notifications

You can use an override for notifications to your favorite method (E-mail, Slack/Discord, MS Teams are supported in Watchtower currently):

You would want to put this in your override

  • For Discord/Slack:
  watchtower:
    environment:
      - WATCHTOWER_NOTIFICATIONS=slack
      - WATCHTOWER_NOTIFICATION_SLACK_HOOK_URL=https://url.discord.com/slack
      - WATCHTOWER_NOTIFICATION_SLACK_IDENTIFIER=watchtower-server-1
  • For E-Mail:
  watchtower:
    environment:
      - [email protected]
      - WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD=secretPassword
      - WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=587
      - [email protected]
      - WATCHTOWER_NOTIFICATION_EMAIL_SERVER=smtp.gmail.com
      - [email protected]
      - WATCHTOWER_NOTIFICATIONS=email

This is what you could have had in your override previously:

version: "3.4"  # this must match the version in docker-compose.yml
services:
    netdata:
      hostname: newhostname

So now your override would look like this:

version: "3.4" # this must match the version in docker-compose.yml
services:
  netdata:
    hostname: newhostname
  watchtower:
    environment:
      - WATCHTOWER_NOTIFICATIONS=slack
      - WATCHTOWER_NOTIFICATION_SLACK_HOOK_URL=https://url.discord.com/slack
      - WATCHTOWER_NOTIFICATION_SLACK_IDENTIFIER=watchtower-server-1