A lightweight webhook receiver that forwards Docker Hub push notifications to a Gotify instance.
596
A lightweight webhook receiver that forwards Docker Hub push notifications to your self-hosted Gotify instance. Get instant notifications when new tags are released for your watched Docker images.
docker run -d \
--name webhook-receiver \
-p 5000:5000 \
-e GOTIFY_URL="http://your-gotify-server:80" \
-e GOTIFY_TOKEN="your-application-token" \
-e WATCHED_IMAGES="nginx,postgres,redis" \
jogojapan/webhook-receiver
version: '3.8'
services:
webhook-receiver:
image: jogojapan/webhook-receiver:latest
ports:
- "5000:5000"
environment:
- GOTIFY_URL=http://gotify:80
- GOTIFY_TOKEN=AaaBbbCccDddEee123456
- WATCHED_IMAGES=nginx,postgres,redis,mysql/mysql-server
restart: unless-stopped
depends_on:
- gotify
gotify:
image: gotify/server
ports:
- "8080:80"
environment:
- GOTIFY_DEFAULTUSER_PASS=your-secure-password
volumes:
- gotify-data:/app/data
restart: unless-stopped
volumes:
gotify-data:
version: '3.8'
services:
webhook-receiver:
image: jogojapan/webhook-receiver:latest
ports:
- "5000:5000"
environment:
- GOTIFY_URL=https://gotify.yourdomain.com
- GOTIFY_TOKEN=AaaBbbCccDddEee123456
- WATCHED_IMAGES=nginx,postgres,redis
restart: unless-stopped
docker-compose up -d
docker-compose logs -f webhook-receiver
| Variable | Description | Required | Example |
|---|---|---|---|
GOTIFY_URL | Full URL to your Gotify server | Yes | http://gotify:80https://gotify.example.com |
GOTIFY_TOKEN | Application token from Gotify | Yes | AaaBbbCccDddEee123456 |
WATCHED_IMAGES | Comma-separated list of Docker images to monitor | Yes | nginx,postgres,redismyuser/myapp,nginx |
GOTIFY_URLhttp://localhost:8080 - Local Gotify instancehttp://gotify:80 - Docker Compose service namehttps://gotify.yourdomain.com - External Gotify with reverse proxyGOTIFY_TOKENWATCHED_IMAGESnginx - Official image (short form)library/nginx - Official image (full form)username/imagename - User repositoryorganization/imagename - Organization repositoryNavigate to your Docker Hub repository
https://hub.docker.com/r/your-username/your-imagehttps://hub.docker.com/_/nginx for official images (requires permissions)Access Webhook Settings
Create New Webhook
Gotify Notificationshttp://your-server-ip:5000/docker-webhookhttp://localhost:5000/docker-webhookhttp://your-vps-ip:5000/docker-webhookhttps://webhooks.yourdomain.com/docker-webhookcurl http://localhost:5000/health
Expected response:
{
"status": "running",
"gotify_url": "http://gotify:80",
"watched_images": ["nginx", "postgres", "redis"]
}
curl -X POST http://localhost:5000/docker-webhook \
-H "Content-Type: application/json" \
-d '{
"action": "push",
"repository": {
"name": "nginx",
"repo_name": "library/nginx"
},
"target": {
"tag": "latest",
"date": "2023-01-01T12:00:00Z"
}
}'
Check your Gotify web interface or mobile app for the test notification.
When a new tag is pushed, you'll receive a Gotify notification like:
๐ณ New Docker Tag Released
Image: library/nginx
Tag: 1.25.3-alpine
Pushed: 2023-12-01T14:30:00Z
Add this to your Docker Hub webhook configuration and update the Python script:
WEBHOOK_SECRET = os.getenv('WEBHOOK_SECRET')
# Add signature verification logic
curl from external sourcedocker-compose logs webhook-receivercurl -X POST "http://your-gotify:80/message?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"title":"Test","message":"Test message"}'
Enable debug logging by modifying the Python script:
app.run(host='0.0.0.0', port=5000, debug=True)
This project is licensed under the MIT License - see the LICENSE file for details.
Content type
Image
Digest
sha256:361ccb64bโฆ
Size
50.6 MB
Last updated
over 1 year ago
docker pull jogojapan/webhook-receiver