Docker container with cronjob, that runs go script once a day. The script fetches notification title and body generated by my weather station server and sends it out to all current web push subscriptions saved in databse running on the same docker network.
-
Create .env file - see
.example.env
-
Add the image to your docker-compose:
services:
notifications:
image: ghcr.io/weather-blade/weather-notifications:latest
restart: unless-stopped
depends_on:
- db
environment:
DATABASE_URL: ${DATABASE_URL}
VAPID_PRIVATE_KEY: ${VAPID_PRIVATE_KEY}
VAPID_PUBLIC_KEY: ${VAPID_PUBLIC_KEY}
db:
image: postgres:latest
- Run Docker
docker compose up