pull/35/head
DoTheEvolution 4 years ago
parent a721794fd0
commit 239685be92

@ -2,54 +2,66 @@
###### guide by example ###### guide by example
### purpose ![logo](https://i.imgur.com/xXS2bzZ.png)
# Purpose
Automatic updates of containers. Automatic updates of containers.
* [Github](https://github.com/containrrr/watchtower) * [Github](https://github.com/containrrr/watchtower)
* [DockerHub image used](https://hub.docker.com/r/containrrr/watchtower) * [DockerHub image used](https://hub.docker.com/r/containrrr/watchtower)
### files and directory structure # Files and directory structure
``` ```
/home /home
└── ~ └── ~
└── docker └── docker
└── watchtower └── watchtower
└── 🗋 docker-compose.yml └── 🗋 docker-compose.yml
``` ```
### docker-compose # docker-compose
[scheduled](https://pkg.go.dev/github.com/robfig/cron@v1.2.0?tab=doc#hdr-CRON_Expression_Format) [scheduled](https://pkg.go.dev/github.com/robfig/cron@v1.2.0?tab=doc#hdr-CRON_Expression_Format)
to run every saturday at midnight</br> to run every saturday at midnight</br>
no need to be on the same network as other containers, no need .env file</br> Heads up that it's not a typical cron format, seconds are the first digit.
`docker-compose.yml` `docker-compose.yml`
```yml
version: '3'
services:
```
version: '3'
services:
watchtower: watchtower:
image: containrrr/watchtower:latest image: containrrr/watchtower:latest
container_name: watchtower container_name: watchtower
hostname: watchtower hostname: watchtower
restart: unless-stopped restart: unless-stopped
environment: env_file: .env
- TZ=Europe/Prague
- WATCHTOWER_SCHEDULE=0 0 0 * * SAT
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_TIMEOUT=30s
- WATCHTOWER_DEBUG=false
- WATCHTOWER_INCLUDE_STOPPED=false
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
``` ```
`.env`
```bash
# GENERAL
MY_DOMAIN=blabla.org
DEFAULT_NETWORK=caddy_net
TZ=Europe/Prague
### reverse proxy # WATCHTOWER
WATCHTOWER_SCHEDULE=0 0 0 * * SAT
WATCHTOWER_CLEANUP=true
WATCHTOWER_TIMEOUT=30s
WATCHTOWER_DEBUG=false
WATCHTOWER_INCLUDE_STOPPED=false
```
no web interface # Update
### update * [watchtower](https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/watchtower) updates itself automaticly
it updates itself * manual image update</br>
`docker-compose pull`</br>
`docker-compose up -d`</br>
`docker image prune`

Loading…
Cancel
Save