You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.5 KiB
Markdown

5 years ago
# Watchtower in docker
###### guide by example
5 years ago
![logo](https://i.imgur.com/xXS2bzZ.png)
# Purpose
5 years ago
Automatic updates of containers.
* [Github](https://github.com/containrrr/watchtower)
* [DockerHub image used](https://hub.docker.com/r/containrrr/watchtower)
5 years ago
# Files and directory structure
```
4 years ago
/home/
└── ~/
└── docker/
└── watchtower/
5 years ago
└── 🗋 docker-compose.yml
```
# docker-compose
5 years ago
Scheduled to run every saturday at midnight</br>
Heads up that not a typical cron format is used,
[seconds are the first digit](https://pkg.go.dev/github.com/robfig/cron@v1.2.0?tab=doc#hdr-CRON_Expression_Format).
5 years ago
`docker-compose.yml`
```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`
```bash
# GENERAL
MY_DOMAIN=blabla.org
DEFAULT_NETWORK=caddy_net
4 years ago
TZ=Europe/Bratislava
5 years ago
# WATCHTOWER
WATCHTOWER_SCHEDULE=0 0 0 * * SAT
WATCHTOWER_CLEANUP=true
WATCHTOWER_TIMEOUT=30s
WATCHTOWER_DEBUG=false
WATCHTOWER_INCLUDE_STOPPED=false
```
# Update
4 years ago
* [watchtower](https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/watchtower) updates itself automaticly
5 years ago
4 years ago
* manual image update</br>
`docker-compose pull`</br>
`docker-compose up -d`</br>
`docker image prune`