-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ntfy] Improve and clean up Frigate notification tutorial
- Pull text message templates from Python code into configuration file - Remove unused code - Type hints - Code formatting - Add Docker Compose configuration for Mosquitto and ntfy services - Update documentation
- Loading branch information
Showing
7 changed files
with
216 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Software component versions. | ||
MOSQUITTO_VERSION=2.0.15 | ||
NTFY_VERSION=latest | ||
|
||
# Broker configuration (Mosquitto). | ||
PORT_MOSQUITTO=1883 | ||
|
||
# Notification service configuration (ntfy). | ||
PORT_NTFY=5555 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
version: "3.8" | ||
|
||
services: | ||
|
||
# --------- | ||
# Mosquitto | ||
# --------- | ||
# https://hub.docker.com/_/eclipse-mosquitto | ||
mosquitto: | ||
image: eclipse-mosquitto:${MOSQUITTO_VERSION} | ||
container_name: mosquitto | ||
command: ["mosquitto", "-c", "/mosquitto-no-auth.conf"] | ||
ports: | ||
- "${PORT_MOSQUITTO}:${PORT_MOSQUITTO}" | ||
|
||
# Define health check for Mosquitto. | ||
healthcheck: | ||
test: [ "CMD", "mosquitto_sub", "-v", "-t", "foobar", "-E" ] | ||
start_period: 1s | ||
interval: 3s | ||
timeout: 10s | ||
retries: 60 | ||
|
||
# ---- | ||
# ntfy | ||
# ---- | ||
# https://docs.ntfy.sh/install/#docker | ||
# https://hub.docker.com/r/binwiederhier/ntfy | ||
ntfy: | ||
image: binwiederhier/ntfy:${NTFY_VERSION} | ||
container_name: ntfy | ||
command: > | ||
serve | ||
--base-url="http://localhost:5555" | ||
--attachment-cache-dir="/tmp/ntfy-attachments" | ||
--attachment-expiry-duration="168h" | ||
environment: | ||
# optional: set desired timezone | ||
- TZ=UTC | ||
ports: | ||
- "${PORT_NTFY}:80" | ||
healthcheck: | ||
test: ["CMD-SHELL", "wget -q --tries=1 http://localhost:5555/v1/health -O - | grep -Eo '\"healthy\"\\s*:\\s*true' || exit 1"] | ||
interval: 60s | ||
timeout: 10s | ||
retries: 3 | ||
start_period: 40s | ||
|
||
# ------- | ||
# Bundler | ||
# ------- | ||
# Wait for all defined services to be fully available by probing their health | ||
# status, even when using `docker compose up --detach`. | ||
# https://marcopeg.com/2019/docker-compose-healthcheck/ | ||
start-dependencies: | ||
image: dadarek/wait-for-dependencies | ||
depends_on: | ||
mosquitto: | ||
condition: service_healthy | ||
ntfy: | ||
condition: service_healthy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.