# Configuration for scrutiny setup

# Name of the big-bear-scrutiny application
name: big-bear-scrutiny
# Service definitions for the big-bear-scrutiny application
services:
  # Service name: big-bear-scrutiny
  # The `big-bear-scrutiny` service definition
  big-bear-scrutiny:
    # Name of the container
    container_name: big-bear-scrutiny
    # Image to be used for the container
    image: ghcr.io/analogj/scrutiny:master-omnibus
    # Container restart policy
    restart: unless-stopped
    # Volumes to be mounted to the container
    volumes:
      # Mount the config directory from the host to the container
      # This allows the user to persist configuration changes
      - /DATA/AppData/$AppID/config:/opt/scrutiny/config
      # Mount the InfluxDB data directory from the host to the container
      # This allows the user to persist data from the InfluxDB database
      - /DATA/AppData/$AppID/influxdb:/opt/scrutiny/influxdb
      # Mount the udev directory from the host to the container
      # This is required for the container to access raw I/O devices
      - /run/udev:/run/udev:ro
    # Expose the following ports from the container to the host
    ports:
      # Map port 8080 from the container to port 38080 on the host.
      # This allows users to access the Scrutiny web interface from the host.
      - "38080:8080"
      # Map port 8086 from the container to port 38086 on the host.
      # This allows users to access the InfluxDB API from the host.
      - "38086:8086"
    # Grant the container the capability to access raw I/O devices
    cap_add:
      # The SYS_RAWIO capability allows the container to access raw I/O devices
      - SYS_RAWIO
    # Map the following host devices to the container
    # This allows Scrutiny to access the raw I/O devices
    devices:
      # Map the /dev/sda device from the host to the container
      # This allows Scrutiny to access the first hard drive
      - /dev/sda:/dev/sda
      # Map the /dev/nvme0 device from the host to the container
      # This allows Scrutiny to access the first NVMe drive
      - /dev/nvme0:/dev/nvme0
    # Allow the container to run in privileged mode.
    # This is required for Scrutiny to access raw I/O devices.
    privileged: true
    # Run a healthcheck on the container to ensure it is running properly
    # The healthcheck is a simple HTTP request to the /api/health endpoint
    # If the endpoint returns a 200 status code, the container is considered healthy
    healthcheck:
      # The command to run to perform the healthcheck
      test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"]
      # The interval between healthchecks
      interval: 1m30s
      # The timeout for the healthcheck command
      timeout: 10s
      # The number of times to retry the healthcheck if it fails
      retries: 3
      # The amount of time to wait after the container starts before running the healthcheck
      start_period: 40s
    x-casaos:
      volumes:
        - container: /opt/scrutiny/config
          description:
            en_us: 'Container Path: /opt/scrutiny/config'
        - container: /opt/scrutiny/influxdb
          description:
            en_us: 'Container Path: /opt/scrutiny/influxdb'
        - container: /run/udev
          description:
            en_us: 'Container Path: /run/udev'
      ports:
        - container: "8080"
          description:
            en_us: 'Container Port: 8080'
        - container: "8086"
          description:
            en_us: 'Container Port: 8086'
x-casaos:
  # Supported CPU architectures for this application
  architectures:
    - amd64
    - arm64
  # Main service for this application
  main: big-bear-scrutiny
  # Detailed description for the application
  description:
    en_us: If you run a server with more than a couple of hard drives, you're probably already familiar with S.M.A.R.T and the smartd daemon.
  # Brief tagline for the application
  tagline:
    en_us: Monitor your server's hard disk health
  # Developer's information
  developer: analogj
  # Author of this particular configuration
  author: BigBearTechWorld
  # Icon URL for the application
  icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/scrutiny.png
  # Thumbnail image for the application (if any)
  thumbnail: ""
  # Title for the application
  title:
    en_us: Scrutiny
  # Category under which the application falls
  category: BigBearCasaOS
  # Default port mapping for the application
  port_map: "38080"
