# big-bear-scrypted configuration
name: big-bear-scrypted
# Services section that specifies how the different services should be run
services:
  # This is the main app service for Scrypted
  scrypted:
    container_name: scrypted
    image: koush/scrypted:v0.144.1-noble-full # Docker image for Scrypted
    network_mode: host # Use host networking mode
    environment:
      # These environment variables are for Scrypted webhook configuration
      - SCRYPTED_WEBHOOK_UPDATE_AUTHORIZATION=Bearer SET_THIS_TO_SOME_RANDOM_TEXT
      - SCRYPTED_WEBHOOK_UPDATE=http://localhost:10444/v1/update
    volumes:
      # Mounting data directory from host to the container
      - /DATA/AppData/$AppID/data:/server/volume
    restart: unless-stopped # Restart policy
    logging:
      # JSON logging configuration
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "10"
    labels:
      # Watchtower label for Scrypted
      - "com.centurylinklabs.watchtower.scope=scrypted"
    x-casaos:
      envs:
        - container: SCRYPTED_WEBHOOK_UPDATE_AUTHORIZATION
          description:
            en_us: 'Container Variable: SCRYPTED_WEBHOOK_UPDATE_AUTHORIZATION'
        - container: SCRYPTED_WEBHOOK_UPDATE
          description:
            en_us: 'Container Variable: SCRYPTED_WEBHOOK_UPDATE'
      volumes:
        - container: /server/volume
          description:
            en_us: 'Container Path: /server/volume'
  # This service manages automatic updates for Scrypted using Watchtower
  watchtower:
    environment:
      # Watchtower configuration environment variables
      - WATCHTOWER_HTTP_API_TOKEN=SET_THIS_TO_SOME_RANDOM_TEXT
      - WATCHTOWER_HTTP_API_UPDATE=true
      - WATCHTOWER_SCOPE=scrypted
      # Allows periodic auto-updates, can be removed if not desired
      - WATCHTOWER_HTTP_API_PERIODIC_POLLS=true
    image: containrrr/watchtower # Docker image for Watchtower
    container_name: watchtower
    restart: unless-stopped
    volumes:
      # Mounting Docker socket for Watchtower to interact with Docker
      - /var/run/docker.sock:/var/run/docker.sock
    labels:
      - "com.centurylinklabs.watchtower.scope=scrypted"
    ports:
      # Mapping the auto-update port; it should match the one in the URL above
      - 10444:8080
    command: --interval 3600 --cleanup --scope scrypted # Command to run watchtower with specified options
    x-casaos:
      envs:
        - container: WATCHTOWER_HTTP_API_TOKEN
          description:
            en_us: 'Container Variable: WATCHTOWER_HTTP_API_TOKEN'
        - container: WATCHTOWER_HTTP_API_UPDATE
          description:
            en_us: 'Container Variable: WATCHTOWER_HTTP_API_UPDATE'
        - container: WATCHTOWER_SCOPE
          description:
            en_us: 'Container Variable: WATCHTOWER_SCOPE'
        - container: WATCHTOWER_HTTP_API_PERIODIC_POLLS
          description:
            en_us: 'Container Variable: WATCHTOWER_HTTP_API_PERIODIC_POLLS'
      volumes:
        - container: /var/run/docker.sock
          description:
            en_us: 'Container Path: /var/run/docker.sock'
      ports:
        - container: "8080"
          description:
            en_us: 'Container Port: 8080'
x-casaos:
  # Supported CPU architectures for this application
  architectures:
    - amd64
    - arm64
  # Main service for this application
  main: scrypted
  # Detailed description for the application
  description:
    en_us: Scrypted is an open source video integration platform. Using various Plugins, Scrypted can receive streams from a range of cameras and send them to other platforms (HomeKit, Google Home, Alexa, Home Assistant).
  # Brief tagline for the application
  tagline:
    en_us: Scrypted
  # Developer's information
  developer: koush
  # Author of this particular configuration
  author: BigBearTechWorld
  # Icon URL for the application
  icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/scrypted.png
  # Thumbnail image for the application (if any)
  thumbnail: ""
  # Title for the application
  title:
    en_us: Scrypted
  # Category under which the application falls
  category: BigBearCasaOS
  # Default port mapping for the application
  port_map: "10443"
