blob: 1d3bc8b6f5c3516c4e0719576fcfc07cb24da080 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# Watchtower
Automatically updates running Docker containers to the latest image versions.
## Setup
1. Copy `.env.example` to `.env`:
```
cp .env.example .env
```
2. Edit `.env` with your SMTP credentials for email notifications.
3. Start:
```
docker compose up -d
```
## What to Configure
- **`.env`** — All SMTP settings. Watchtower will send email notifications after updates (or if updates fail).
- **Schedule** — `WATCHTOWER_SCHEDULE=0 0 4 * * 0` runs every Sunday at 4 AM. Uses 6-field cron. Change as desired.
- **Docker socket** — Mounts `/var/run/docker.sock`. Required for Watchtower to manage containers.
- **Cleanup** — `WATCHTOWER_CLEANUP=true` removes old images after updates. Set to `false` if you want to keep them.
- **Scope labels** — To exclude a container from auto-updates, add `com.centurylinklabs.watchtower.scope=ignore` to its container labels.
|