A lightweight Prometheus Alertmanager webhook that forwards alerts to Gotify - perfect for homelabs, self-hosted setups, and production environments.
---
services:
alertmanager-gotify:
image: docker.io/${GROUP:-mardinlimunir}/${PROJECT:-alertmanager-gotify}:${TAG:-latest}
container_name: alertmanager-gotify
hostname: alertmanager-gotify
restart: always
ports:
- ${GOTIFY_PORT:-9094}:9094
volumes:
- type: bind
source: /etc/localtime
target: /etc/localtime
read_only: true
environment:
GOTIFY_ALERT_URL: ${GOTIFY_ALERT_URL?:App Token is missing}
GOTIFY_PORT: ${GOTIFY_PORT:-9094}
UID: ${UID_NAS_ADMIN:-1026} #optional
GID: ${GID_NAS_ADMIN:-100} #optional
networks:
dockerization:
labels:
com.centurylinklabs.watchtower.enable: true
networks:
dockerization:
external: true
folder
:cd alertmanager-gotify
Start
the desired compose stack:docker-compose -f server.yml up -d
Variable | Required | Default | Description |
---|---|---|---|
GOTIFY_URL |
Yes | - | Full URL of your Gotify server (e.g., http://gotify/message?token= ) |
GOTIFY_PORT |
No | 9094 |
Port for Gotify server (if not using default 80/443) |
GOTIFY_ALERT_URL |
Yes | http://gotify |
Fallback Gotify base URL (used if GOTIFY_URL not set) |
Variable | Required | Default | Description |
---|---|---|---|
NODE_ENV |
No | development |
Runtime environment (production /development ) |
.env
file: GOTIFY_ALERT_URL=http://gotify/message?token=
GOTIFY_PORT=4000
NODE_ENV=production
# alertmanager.yml
receivers:
- name: 'gotify-alerts'
webhook_configs:
- url: 'http://alertmanager-gotify:8080'
send_resolved: true
route:
receiver: 'gotify-alerts'