# SPDX-License-Identifier: MIT
# ntfy on the measured requirements bench: the installation of Simafri's ntfy guide
# (https://www.simafri.com/en/guides/self-host-ntfy/), itself based on the official documentation,
# with two changes, both outside the application:
#   - the image is pinned by tag AND digest;
#   - the port is published on the bench's private address instead of 127.0.0.1, since the load
#     generator stands where the reverse proxy would be (the proxy is measured apart, once).
services:
  ntfy:
    image: binwiederhier/ntfy:v2.38.3@sha256:874299b207a9815e7a0cf551b3a094241db7604fa2d274bbd86f569154b6ea51
    container_name: ntfy
    command:
      - serve
    environment:
      - TZ=UTC
    volumes:
      - ./etc:/etc/ntfy
      - ./lib:/var/lib/ntfy
    ports:
      - "10.30.0.207:2586:80"
    healthcheck:
      test: ["CMD-SHELL", "wget -q --tries=1 http://localhost:80/v1/health -O - | grep -Eo '\"healthy\"\\s*:\\s*true' || exit 1"]
      interval: 60s
      timeout: 10s
      retries: 3
      start_period: 40s
    restart: unless-stopped
    init: true
