Deployment
For production (e.g. Raspberry Pi), use a WSGI server and run Nokwatch as a system service.
Gunicorn
pip install gunicorn
gunicorn -w 2 -b 0.0.0.0:5000 app:app Systemd (Raspberry Pi)
Create /etc/systemd/system/nokwatch.service:
[Unit]
Description=Nokwatch Website Monitor
After=network.target
[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi/nokwatch
Environment="PATH=/home/pi/nokwatch/.venv/bin"
ExecStart=/home/pi/nokwatch/.venv/bin/gunicorn -w 2 -b 0.0.0.0:5000 app:app
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target Then:
sudo systemctl daemon-reload
sudo systemctl enable nokwatch.service
sudo systemctl start nokwatch.service Adjust User, WorkingDirectory, and Environment to match your install path.
HTTPS
Put nginx (or another reverse proxy) in front and use HTTPS. Never commit .env or the database.