A Python script that monitors your website for outages and sends Discord notifications via Docker.
- Checks website status every 5 minutes
- Logs all checks and response times
- Sends Discord alerts when the website goes down
- Tracks CPU usage
- Runs 24/7 in a Docker container
- Docker and Docker Compose installed
- Discord webhook URL
- Clone the repository:
git clone https://github.com/yourusername/WebsiteMonitor.git
cd WebsiteMonitor- Create a
.envfile with your Discord webhook:
echo "DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/..." > .env- Build and run with Docker Compose:
docker-compose up -dView logs:
docker-compose logs -fStop the container:
docker-compose downRestart the container:
docker-compose restartEdit main.py to change:
WEBSITE_URL: The website to monitorCHECK_INTERVAL: How often to check (in seconds)
Logs are written to luxline_monitor.log in the project directory.
Never commit your Discord webhook URL to GitHub!
Always use the .env file (which is in .gitignore) for secrets.