diff --git a/projects/ntfy/README.md b/projects/ntfy/README.md new file mode 100644 index 0000000..c48475d --- /dev/null +++ b/projects/ntfy/README.md @@ -0,0 +1,26 @@ +# [ntfy](https://ntfy.sh) + +## ntfy + +### General + +- Compose Path: `./projects/ntfy/docker-compose.yml` + +### Environment + +- NTFY_HOST: `https://ntfy.example.com` +- HTTP_PORT: `80` +- TZ: `Europe/Berlin` + +### Domains + +- Service Name: `ntfy` +- Container Port: `80` +- HTTPS: `true` +- Certificate Provider: `Let's Encrypt` + +### Notes + +- ntfy stores persistent state in the `ntfy_data` volume. +- Set `NTFY_BASE_URL` to the public URL used by your reverse proxy. +- If you want authentication, configure the ntfy auth db or add a custom wrapper config. diff --git a/projects/ntfy/docker-compose.yml b/projects/ntfy/docker-compose.yml new file mode 100644 index 0000000..b402704 --- /dev/null +++ b/projects/ntfy/docker-compose.yml @@ -0,0 +1,35 @@ +services: + ntfy: + image: binwiederhier/ntfy:latest + restart: unless-stopped + command: + - serve + environment: + NTFY_BASE_URL: https://${NTFY_HOST} + NTFY_LISTEN_HTTP: ":${HTTP_PORT}" + NTFY_BEHIND_PROXY: "true" + NTFY_AUTH_FILE: /var/lib/ntfy/user.db + NTFY_AUTH_DEFAULT_ACCESS: deny-all + NTFY_ENABLE_LOGIN: "true" + NTFY_REQUIRE_LOGIN: "true" + NTFY_CACHE_FILE: /var/cache/ntfy/cache.db + NTFY_CACHE_DURATION: 24h + NTFY_UPSTREAM_BASE_URL: https://ntfy.sh + TZ: ${TZ} + expose: + - "${HTTP_PORT}" + volumes: + - ntfy-data:/var/lib/ntfy + - ntfy-cache:/var/cache/ntfy + - ../files/server.yml:/etc/ntfy/server.yml:ro + - ../files/templates:/etc/ntfy/templates:ro + healthcheck: + test: ["CMD-SHELL", "wget -q --tries=1 http://localhost:${HTTP_PORT}/v1/health -O - | grep -Eo '\"healthy\"\\s*:\\s*true' || exit 1"] + interval: 60s + timeout: 10s + retries: 3 + start_period: 40s + +volumes: + ntfy-data: + ntfy-cache: \ No newline at end of file