# Configuration for photoprism setup

# Name of the big-bear-photoprism application
name: big-bear-photoprism
# Service definitions for the big-bear-photoprism application
services:
  # Service name: app
  # The `app` service definition
  app:
    # Name of the container
    container_name: big-bear-photoprism
    # Image to be used for the container
    image: photoprism/photoprism:240915
    environment:
      PHOTOPRISM_ADMIN_PASSWORD: casaos
      PHOTOPRISM_SITE_URL: "http://locahost/"
      PHOTOPRISM_ORIGINALS_LIMIT: "5000"
      PHOTOPRISM_HTTP_COMPRESSION: "gzip"
      PHOTOPRISM_LOG_LEVEL: "info"
      PHOTOPRISM_PUBLIC: "false"
      PHOTOPRISM_READONLY: "false"
      PHOTOPRISM_EXPERIMENTAL: "false"
      PHOTOPRISM_DISABLE_CHOWN: "false"
      PHOTOPRISM_DISABLE_WEBDAV: "false"
      PHOTOPRISM_DISABLE_SETTINGS: "false"
      PHOTOPRISM_DISABLE_TENSORFLOW: "false"
      PHOTOPRISM_DISABLE_FACES: "false"
      PHOTOPRISM_DISABLE_CLASSIFICATION: "false"
      PHOTOPRISM_DISABLE_RAW: "false"
      PHOTOPRISM_RAW_PRESETS: "false"
      PHOTOPRISM_JPEG_QUALITY: "85"
      PHOTOPRISM_DETECT_NSFW: "false"
      PHOTOPRISM_UPLOAD_NSFW: "true"
      PHOTOPRISM_DATABASE_DRIVER: "mysql"
      PHOTOPRISM_DATABASE_SERVER: "big-bear-photoprism-db:3306"
      PHOTOPRISM_DATABASE_NAME: "photoprism"
      PHOTOPRISM_DATABASE_USER: "photoprism"
      PHOTOPRISM_DATABASE_PASSWORD: "casaos"
      PHOTOPRISM_SITE_CAPTION: "AI-Powered Photos App"
    # Container restart policy: restart the container unless it was stopped manually
    restart: unless-stopped
    # File system volumes to be mounted to the container
    volumes:
      # Mount points for originals and storage
      - "/DATA/AppData/$AppID/originals:/photoprism/originals"
      - "/DATA/AppData/$AppID/storage:/photoprism/storage"
    # Network ports mapping between the host and the container
    ports:
      - "2342:2342" # Map host port 2342 to container port 2342
    # Networks to be attached to the container
    networks:
      - photoprism-network
    # Other services that this service depends on
    depends_on:
      - photoprism-db
    x-casaos:
      envs:
        - container: PHOTOPRISM_ADMIN_PASSWORD
          description:
            en_us: 'Container Variable: PHOTOPRISM_ADMIN_PASSWORD'
        - container: PHOTOPRISM_SITE_URL
          description:
            en_us: 'Container Variable: PHOTOPRISM_SITE_URL'
        - container: PHOTOPRISM_ORIGINALS_LIMIT
          description:
            en_us: 'Container Variable: PHOTOPRISM_ORIGINALS_LIMIT'
        - container: PHOTOPRISM_HTTP_COMPRESSION
          description:
            en_us: 'Container Variable: PHOTOPRISM_HTTP_COMPRESSION'
        - container: PHOTOPRISM_LOG_LEVEL
          description:
            en_us: 'Container Variable: PHOTOPRISM_LOG_LEVEL'
        - container: PHOTOPRISM_PUBLIC
          description:
            en_us: 'Container Variable: PHOTOPRISM_PUBLIC'
        - container: PHOTOPRISM_READONLY
          description:
            en_us: 'Container Variable: PHOTOPRISM_READONLY'
        - container: PHOTOPRISM_EXPERIMENTAL
          description:
            en_us: 'Container Variable: PHOTOPRISM_EXPERIMENTAL'
        - container: PHOTOPRISM_DISABLE_CHOWN
          description:
            en_us: 'Container Variable: PHOTOPRISM_DISABLE_CHOWN'
        - container: PHOTOPRISM_DISABLE_WEBDAV
          description:
            en_us: 'Container Variable: PHOTOPRISM_DISABLE_WEBDAV'
        - container: PHOTOPRISM_DISABLE_SETTINGS
          description:
            en_us: 'Container Variable: PHOTOPRISM_DISABLE_SETTINGS'
        - container: PHOTOPRISM_DISABLE_TENSORFLOW
          description:
            en_us: 'Container Variable: PHOTOPRISM_DISABLE_TENSORFLOW'
        - container: PHOTOPRISM_DISABLE_FACES
          description:
            en_us: 'Container Variable: PHOTOPRISM_DISABLE_FACES'
        - container: PHOTOPRISM_DISABLE_CLASSIFICATION
          description:
            en_us: 'Container Variable: PHOTOPRISM_DISABLE_CLASSIFICATION'
        - container: PHOTOPRISM_DISABLE_RAW
          description:
            en_us: 'Container Variable: PHOTOPRISM_DISABLE_RAW'
        - container: PHOTOPRISM_RAW_PRESETS
          description:
            en_us: 'Container Variable: PHOTOPRISM_RAW_PRESETS'
        - container: PHOTOPRISM_JPEG_QUALITY
          description:
            en_us: 'Container Variable: PHOTOPRISM_JPEG_QUALITY'
        - container: PHOTOPRISM_DETECT_NSFW
          description:
            en_us: 'Container Variable: PHOTOPRISM_DETECT_NSFW'
        - container: PHOTOPRISM_UPLOAD_NSFW
          description:
            en_us: 'Container Variable: PHOTOPRISM_UPLOAD_NSFW'
        - container: PHOTOPRISM_DATABASE_DRIVER
          description:
            en_us: 'Container Variable: PHOTOPRISM_DATABASE_DRIVER'
        - container: PHOTOPRISM_DATABASE_SERVER
          description:
            en_us: 'Container Variable: PHOTOPRISM_DATABASE_SERVER'
        - container: PHOTOPRISM_DATABASE_NAME
          description:
            en_us: 'Container Variable: PHOTOPRISM_DATABASE_NAME'
        - container: PHOTOPRISM_DATABASE_USER
          description:
            en_us: 'Container Variable: PHOTOPRISM_DATABASE_USER'
        - container: PHOTOPRISM_DATABASE_PASSWORD
          description:
            en_us: 'Container Variable: PHOTOPRISM_DATABASE_PASSWORD'
        - container: PHOTOPRISM_SITE_CAPTION
          description:
            en_us: 'Container Variable: PHOTOPRISM_SITE_CAPTION'
      volumes:
        - container: /photoprism/originals
          description:
            en_us: 'Container Path: /photoprism/originals'
        - container: /photoprism/storage
          description:
            en_us: 'Container Path: /photoprism/storage'
      ports:
        - container: "2342"
          description:
            en_us: 'Container Port: 2342'
  # Database service for Photoprism
  photoprism-db:
    # Docker image for the database
    image: mariadb:10.8
    # Restart policy for the database container
    restart: unless-stopped
    # Container name for the database
    container_name: big-bear-photoprism-db
    # Command and options for the database service
    command: ["mysqld", "--innodb-buffer-pool-size=128M", "--transaction-isolation=READ-COMMITTED", "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci", "--max-connections=512", "--innodb-rollback-on-timeout=OFF", "--innodb-lock-wait-timeout=120"] # File system volumes for the database
    volumes:
      - "/DATA/AppData/$AppID/mysql:/var/lib/mysql"
    # Environment variables for the MariaDB
    environment:
      MARIADB_DATABASE: "photoprism"
      MARIADB_USER: "photoprism"
      MARIADB_PASSWORD: "casaos"
      MARIADB_ROOT_PASSWORD: "casaos"
    # Network configurations for the database
    networks:
      - photoprism-network
    x-casaos:
      envs:
        - container: MARIADB_DATABASE
          description:
            en_us: 'Container Variable: MARIADB_DATABASE'
        - container: MARIADB_USER
          description:
            en_us: 'Container Variable: MARIADB_USER'
        - container: MARIADB_PASSWORD
          description:
            en_us: 'Container Variable: MARIADB_PASSWORD'
        - container: MARIADB_ROOT_PASSWORD
          description:
            en_us: 'Container Variable: MARIADB_ROOT_PASSWORD'
      volumes:
        - container: /var/lib/mysql
          description:
            en_us: 'Container Path: /var/lib/mysql'
# Define the networks section
networks:
  # Define the photoprism-network
  photoprism-network:
    # Set the driver to bridge
    driver: bridge
x-casaos:
  # Supported CPU architectures for this application
  architectures:
    - amd64
    - arm64
  # Main service for this application
  main: app
  # Detailed description for the application
  description:
    en_us: PhotoPrism® is an AI-Powered Photos App for the Decentralized Web. It makes use of the latest technologies to tag and find pictures automatically without getting in your way. You can run it at home, on a private server, or in the cloud.
  # Brief tagline for the application
  tagline:
    en_us: AI-Powered Photos App
  # Developer's information
  developer: photoprism.app
  # Author of this particular configuration
  author: BigBearTechWorld
  # Icon URL for the application
  icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/photoprism.png
  # Thumbnail image for the application (if any)
  thumbnail: ""
  # Title for the application
  title:
    en_us: Photoprism
  # Category under which the application falls
  category: BigBearCasaOS
  # Default port mapping for the application
  port_map: "2342"
