selfhosted-apps-docker/watchtower
DoTheEvolution c80eab3591 update
2020-04-27 23:01:48 +02:00
..
readme.md update 2020-04-27 23:01:48 +02:00

Watchtower in docker

guide by example

logo

Purpose

Automatic updates of containers.

Files and directory structure

/home
└── ~
    └── docker
        └── watchtower
            └── 🗋 docker-compose.yml

docker-compose

Scheduled to run every saturday at midnight
Heads up that not a typical cron format is used, seconds are the first digit.

docker-compose.yml

version: '3'
services:

  watchtower:
    image: containrrr/watchtower:latest
    container_name: watchtower
    hostname: watchtower
    restart: unless-stopped
    env_file: .env
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

.env

# GENERAL
MY_DOMAIN=blabla.org
DEFAULT_NETWORK=caddy_net
TZ=Europe/Prague

# WATCHTOWER
WATCHTOWER_SCHEDULE=0 0 0 * * SAT
WATCHTOWER_CLEANUP=true
WATCHTOWER_TIMEOUT=30s
WATCHTOWER_DEBUG=false
WATCHTOWER_INCLUDE_STOPPED=false

Update

  • watchtower updates itself automaticly

  • manual image update
    docker-compose pull
    docker-compose up -d
    docker image prune