Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mjaschen/urlwatch-docker
Run urlwatch in a Docker container or as a Docker compose service
https://github.com/mjaschen/urlwatch-docker
Last synced: 30 days ago
JSON representation
Run urlwatch in a Docker container or as a Docker compose service
- Host: GitHub
- URL: https://github.com/mjaschen/urlwatch-docker
- Owner: mjaschen
- License: mit
- Created: 2020-12-24T14:57:31.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-02-10T10:25:55.000Z (11 months ago)
- Last Synced: 2024-10-16T08:55:42.553Z (3 months ago)
- Language: Dockerfile
- Size: 28.3 KB
- Stars: 5
- Watchers: 3
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Setup
1. add URLs to `data/urls.yaml` (see `data/urls.example.yaml` for two simple examples or see the [Jobs section](https://urlwatch.readthedocs.io/en/latest/jobs.html) in the *urlwatch* documentation for all details)
1. copy `data/urlwatch.template.yaml` to `data/urlwatch.yaml` and configure at least one reporter (e.g. SMTP account details)
1. run *urlwatch*:```shell
docker-compose up -d# watch log output
docker-compose logs -f# stop urlwatch
docker-compose down
```### Run Without Docker Compose
If you don't want to use *Docker Compose*, you can run the container with *Docker*:
```shell
# run once
docker run --rm --interactive --tty \
--volume "$(pwd)/data":/data/urlwatch \
--volume /etc/localtime:/etc/localtime:ro \
ghcr.io/mjaschen/urlwatch# run in background and restart automatically
docker run --tty --detach --restart unless-stopped \
--name urlwatch \
--volume "$(pwd)/data":/data/urlwatch \
--volume /etc/localtime:/etc/localtime:ro \
ghcr.io/mjaschen/urlwatch# watch log output
docker logs --follow urlwatch
```### Change *cron* interval
*urlwatch* runs once every 15 minutes by default. It's possible to change this interval by editing the provided `crontab` file and mounting it into the container.
To run every hour instead of the default 15 minutes, change `crontab` as follows:
```crontab
0 * * * * cd /data/urlwatch && urlwatch --verbose --urls urls.yaml --config urlwatch.yaml --hooks hooks.py --cache cache.db
```Mount `crontab` into the container:
```shell
docker-compose run --rm --volume "$(pwd)/crontabfile:/crontabfile:ro" --volume "$(pwd):/data" --volume /etc/localtime:/etc/localtime:ro urlwatch
```or add the mount to `docker-compose.yml`:
```yaml
version: '3'networks:
urlwatch:services:
urlwatch:
image: ghcr.io/mjaschen/urlwatch
volumes:
- ./crontabfile:/crontabfile:ro
- ./data:/data/urlwatch
- /etc/localtime:/etc/localtime:ro
restart: "unless-stopped"
networks:
- urlwatch
```## Build Locally
- clone the repository: `git clone [email protected]:mjaschen/urlwatch-docker.git`
- adjust the interval in crontab if necessary (urlwatch is started every 15 minutes by default)
- build the image and run *urlwatch*