# Alerting Stack for Homelab

services:
  alertmanager:
    image: prom/alertmanager:latest
    container_name: alertmanager
    restart: unless-stopped
    ports:
      - "9093:9093"
    volumes:
      - ./alertmanager:/etc/alertmanager
      - alertmanager-data:/alertmanager
    command:
      - '--config.file=/etc/alertmanager/alertmanager.yml'
      - '--storage.path=/alertmanager'
      - '--web.external-url=http://localhost:9093'
    networks:
      - monitoring-stack_default
      - signal-api-stack_default
      - ntfy-stack_default

  signal-bridge:
    build: ./signal-bridge
    container_name: signal-bridge
    restart: unless-stopped
    ports:
      - "5000:5000"
    environment:
      - SIGNAL_API_URL=http://signal-api:8080
      - SIGNAL_SENDER=REDACTED_PHONE_NUMBER
      - SIGNAL_RECIPIENTS=REDACTED_PHONE_NUMBER
    networks:
      - monitoring-stack_default
      - signal-api-stack_default
    healthcheck:
      test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5000/health')"]
      interval: 30s
      timeout: 10s
      retries: 3

  ntfy-bridge:
    build: ./ntfy-bridge
    container_name: ntfy-bridge
    restart: unless-stopped
    ports:
      - "5001:5001"
    environment:
      - NTFY_URL=http://NTFY:80
      - NTFY_TOPIC="REDACTED_NTFY_TOPIC"
    networks:
      - monitoring-stack_default
      - ntfy-stack_default
    healthcheck:
      test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5001/health')"]
      interval: 30s
      timeout: 10s
      retries: 3

volumes:
  alertmanager-data:

networks:
  monitoring-stack_default:
    external: true
  signal-api-stack_default:
    external: true
  ntfy-stack_default:
    external: true
