# Docker Compose configuration for BigBearCasaOS Stirling PDF Service
# This service provides a web interface for a Local hosted web based PDF editor

# Name of the big-bear-stirling-pdf application
name: big-bear-stirling-pdf
# Service definitions for the big-bear-stirling-pdf application
services:
  # Main service configuration for the CasaOS User Management application
  # This service provides a web interface running on port 5000 for user administration
  big-bear-stirling-pdf:
    # Name of the container
    container_name: big-bear-stirling-pdf
    # Image to be used for the container specifies the stirling-pdf version and source
    image: stirlingtools/stirling-pdf:2.13.1
    # Container restart policy - restarts the container unless manually stopped
    restart: unless-stopped
    # Environment variables for service configuration
    environment:
      # Set to true to download security jar (required for authentication login)
      - DOCKER_ENABLE_SECURITY=false
      # Set to true to enable login for authentication
      - SECURITY_ENABLE_LOGIN=true
      # Set the initial admin username
      - SECURITY_INITIALLOGIN_USERNAME=bigbear
      # Set the initial admin password
      - SECURITY_INITIALLOGIN_PASSWORD=4500733e-a0f8-4605-a712-fd267404956a
      # Set to true to enable CSRF protection
      - CSRF_DISABLED=false
      # Set the default locale for the application
      - DEFAULT_LOCALE=en-US
      # Download Calibre onto Stirling-PDF to enable PDF to/from book and advanced HTML conversion
      - INSTALL_BOOK_AND_ADVANCED_HTML_OPS=false
      # Define custom font libraries to install for document conversions
      - LANGS=en_US
    # Volume mappings for persistent storage and configuration
    # These mounts allow the container to interact with the host system
    volumes:
      # Required for monitoring system resources and container metrics
      - /DATA/AppData/$AppID/tessdata:/usr/share/tessdata # Required for extra OCR languages
      - /DATA/AppData/$AppID/configs:/configs
    # Map port 8080 on the host to port 8080 on the container
    ports:
      - "8080:8080"
    x-casaos:
      envs:
        - container: DOCKER_ENABLE_SECURITY
          description:
            en_us: 'Container Variable: DOCKER_ENABLE_SECURITY'
        - container: SECURITY_ENABLE_LOGIN
          description:
            en_us: 'Container Variable: SECURITY_ENABLE_LOGIN'
        - container: SECURITY_INITIALLOGIN_USERNAME
          description:
            en_us: 'Container Variable: SECURITY_INITIALLOGIN_USERNAME'
        - container: SECURITY_INITIALLOGIN_PASSWORD
          description:
            en_us: 'Container Variable: SECURITY_INITIALLOGIN_PASSWORD'
        - container: CSRF_DISABLED
          description:
            en_us: 'Container Variable: CSRF_DISABLED'
        - container: DEFAULT_LOCALE
          description:
            en_us: 'Container Variable: DEFAULT_LOCALE'
        - container: INSTALL_BOOK_AND_ADVANCED_HTML_OPS
          description:
            en_us: 'Container Variable: INSTALL_BOOK_AND_ADVANCED_HTML_OPS'
        - container: LANGS
          description:
            en_us: 'Container Variable: LANGS'
      volumes:
        - container: /usr/share/tessdata
          description:
            en_us: 'Container Path: /usr/share/tessdata'
        - container: /configs
          description:
            en_us: 'Container Path: /configs'
      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: big-bear-stirling-pdf
  # Detailed description for the application
  description:
    en_us: Stirling PDF - Local hosted web based PDF editor
  # Brief tagline for the application
  tagline:
    en_us: Stirling PDF - Local hosted web based PDF editor
  # Developer's information
  developer: stirlingtools
  # Author of this particular configuration
  author: BigBearTechWorld
  # Icon URL for the application
  icon: https://cdn.jsdelivr.net/gh/bigbeartechworld/big-bear-universal-apps/apps/stirling-pdf/logo.png
  # Thumbnail image for the application (if any)
  thumbnail: ""
  # Installation tips
  tips:
    before_install:
      en_us: |
        Read this before installing: https://community.bigbeartechworld.com/t/added-stirling-pdf-to-bigbearcasaos/2265#p-4248-documentation-3
  # Title for the application
  title:
    en_us: Stirling-PDF
  # Category under which the application falls
  category: BigBearCasaOS
  # Default port mapping for the application
  port_map: "8080"
