# Configuration for lancache setup

# Name of the big-bear-lancache application
name: big-bear-lancache
# Service definitions for the big-bear-lancache application
services:
  # Service name: app
  app:
    image: lancachenet/monolithic:latest # Docker image for the caching service
    environment:
      # Toggle for load balancer usage or separate IPs for each service
      - USE_GENERIC_CACHE=true
      # IPs for lancache monolithic instance; affects DNS resolution
      - LANCACHE_IP=10.0.39.1
      # Host IP for the DNS server binding
      - DNS_BIND_IP=10.0.39.1
      # Upstream DNS for forwarded lookups
      - UPSTREAM_DNS=8.8.8.8
      # Local storage path for cache data
      - CACHE_ROOT=./lancache
      # Customizable disk cache size
      - CACHE_DISK_SIZE=2000g
      # Memory allocation for nginx cache indexing
      - CACHE_INDEX_SIZE=500m
      # Maximum age for cached content
      - CACHE_MAX_AGE=3650d
      # Container timezone setting for log timestamps
      - TZ=UTC
    restart: unless-stopped
    ports:
      - 8080:80
      - 10443:443
    volumes:
      # Mount points for cache and logs
      - /DATA/AppData/$AppID/cache:/data/cache
      - /DATA/AppData/$AppID/logs:/data/logs
    x-casaos:
      envs:
        - container: USE_GENERIC_CACHE
          description:
            en_us: 'Container Variable: USE_GENERIC_CACHE'
        - container: LANCACHE_IP
          description:
            en_us: 'Container Variable: LANCACHE_IP'
        - container: DNS_BIND_IP
          description:
            en_us: 'Container Variable: DNS_BIND_IP'
        - container: UPSTREAM_DNS
          description:
            en_us: 'Container Variable: UPSTREAM_DNS'
        - container: CACHE_ROOT
          description:
            en_us: 'Container Variable: CACHE_ROOT'
        - container: CACHE_DISK_SIZE
          description:
            en_us: 'Container Variable: CACHE_DISK_SIZE'
        - container: CACHE_INDEX_SIZE
          description:
            en_us: 'Container Variable: CACHE_INDEX_SIZE'
        - container: CACHE_MAX_AGE
          description:
            en_us: 'Container Variable: CACHE_MAX_AGE'
        - container: TZ
          description:
            en_us: 'Container Variable: TZ'
      volumes:
        - container: /data/cache
          description:
            en_us: 'Container Path: /data/cache'
        - container: /data/logs
          description:
            en_us: 'Container Path: /data/logs'
      ports:
        - container: "80"
          description:
            en_us: 'Container Port: 80'
        - container: "443"
          description:
            en_us: 'Container Port: 443'
  # DNS service configuration
  dns:
    image: lancachenet/lancache-dns:latest # Docker image for DNS service
    environment:
      # Toggle for load balancer usage or separate IPs for each service
      - USE_GENERIC_CACHE=true
      # IPs for lancache monolithic instance; affects DNS resolution
      - LANCACHE_IP=10.0.39.1
      # Host IP for the DNS server binding
      - DNS_BIND_IP=10.0.39.1
      # Upstream DNS for forwarded lookups
      - UPSTREAM_DNS=8.8.8.8
      # Local storage path for cache data
      - CACHE_ROOT=./lancache
      # Customizable disk cache size
      - CACHE_DISK_SIZE=2000g
      # Memory allocation for nginx cache indexing
      - CACHE_INDEX_SIZE=500m
      # Maximum age for cached content
      - CACHE_MAX_AGE=3650d
      # Container timezone setting for log timestamps
      - TZ=UTC
    restart: unless-stopped
    ports:
      - 53:53/udp
      - 53:53/tcp
    x-casaos:
      envs:
        - container: USE_GENERIC_CACHE
          description:
            en_us: 'Container Variable: USE_GENERIC_CACHE'
        - container: LANCACHE_IP
          description:
            en_us: 'Container Variable: LANCACHE_IP'
        - container: DNS_BIND_IP
          description:
            en_us: 'Container Variable: DNS_BIND_IP'
        - container: UPSTREAM_DNS
          description:
            en_us: 'Container Variable: UPSTREAM_DNS'
        - container: CACHE_ROOT
          description:
            en_us: 'Container Variable: CACHE_ROOT'
        - container: CACHE_DISK_SIZE
          description:
            en_us: 'Container Variable: CACHE_DISK_SIZE'
        - container: CACHE_INDEX_SIZE
          description:
            en_us: 'Container Variable: CACHE_INDEX_SIZE'
        - container: CACHE_MAX_AGE
          description:
            en_us: 'Container Variable: CACHE_MAX_AGE'
        - container: TZ
          description:
            en_us: 'Container Variable: TZ'
      ports:
        - container: "53"
          description:
            en_us: 'Container Port: 53'
        - container: "53"
          description:
            en_us: 'Container Port: 53'
x-casaos:
  # Supported CPU architectures for this application
  architectures:
    - amd64
  # Main service for this application
  main: app
  # Detailed description for the application
  description:
    en_us: Make the most of your network. Get more play for your gamers. Download your games once and serve them out to many people at your LAN.
  # Brief tagline for the application
  tagline:
    en_us: LAN Party game caching made easy
  # Developer's information
  developer: lancachenet
  # Author of this particular configuration
  author: BigBearTechWorld
  # Icon URL for the application
  icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/lancache-net.png
  # Thumbnail image for the application (if any)
  thumbnail: ""
  # Title for the application
  title:
    en_us: LAN Cache
  # Category under which the application falls
  category: BigBearCasaOS
  # Default port mapping for the application
  port_map: "8080"
