_____ _ _
\_ \___ ___ ___ (_) __| |
/ /\/ __/ _ \/ _ \| |/ _` |
/\/ /_| (_| __/ (_) | | (_| |
\____/ \___\___|\___/|_|\__,_|
-
Using gmail smtp server for email notifications by default.
-
The container will check the websites every hour by default. You can overwrite this behavior if you provide a file named custom-cron and bind-mount it in the container in
/etc/cron.d
. See the docker-compose.yml example below. Here is the cron expression documentation and a cron expression generator. -
Here are the environment variables to either provide or optionally modify:
Env variable | Description | Default | Example |
---|---|---|---|
EMAIL_ADDRESS required |
The email used to send the alert from and to. | none | [email protected] |
EMAIL_PASSWORD required |
Your email passwordused. It is recommended to generate an app password from your gmail account. | none | EMAIL_PASSWORD=password |
URLS required |
URLs to be monitored. They are delimited by a comma. | none | URLS=website.com,b.org,https://c.io |
SMTP_SERVER (optional) |
smtp server address | smtp.gmail.com |
SMTP_SERVER=smtp.mail.yahoo.com |
SMTP_PORT (optional) |
smtp port to be used. (25, SSL: 465, TLS: 587) | 465 |
SMTP_PORT=587 |
EMAIL_LIST (optional) |
Email list to send the alert to. | same value as EMAIL_ADDRESS |
[email protected],[email protected] |
TZ (optional) |
Timezone. Here is a list of possible values. | America/Toronto |
TZ=America/Toronto |
*/5 * * * * python3 monitor-websites.py
# This file must end with an empty or commented line
version: '3.6'
services:
web-monitor:
image: ghcr.io/iceoid/website-monitoring-docker
container_name: web-monitor
restart: unless-stopped
environment:
- EMAIL_ADDRESS=$EMAIL_ADDRESS
- EMAIL_PASSWORD=$EMAIL_PASSWORD
# URLS are delimited by a comma i.e a.com,http://b.net,https://c.io
- URLS=$URLS
- TZ=America/Toronto
volumes:
- ./scripts/custom-cron:/ect/cron.d/