# Name of the application
name: big-bear-umami
# List of services that this application uses
services:
  # Main service for the Umami application
  app:
    image: ghcr.io/umami-software/umami:postgresql-latest # Docker image for the Umami app
    ports:
      - "3000:3000" # Port mapping: host:container
    environment: # Environment variables for the service
      DATABASE_URL: postgresql://umami:umami@db:5432/umami
      DATABASE_TYPE: postgresql
      APP_SECRET: replace-me-with-a-random-string
    depends_on: # Dependency of this service
      db:
        condition: service_healthy
    restart: always # Restart policy
    x-casaos:
      envs:
        - container: DATABASE_URL
          description:
            en_us: 'Container Variable: DATABASE_URL'
        - container: DATABASE_TYPE
          description:
            en_us: 'Container Variable: DATABASE_TYPE'
        - container: APP_SECRET
          description:
            en_us: 'Container Variable: APP_SECRET'
      ports:
        - container: "3000"
          description:
            en_us: 'Container Port: 3000'
  # Database service for the Umami application
  db:
    image: postgres:15-alpine # Docker image for the PostgreSQL database
    environment: # Environment variables for the service
      POSTGRES_DB: umami
      POSTGRES_USER: umami
      POSTGRES_PASSWORD: umami
    volumes: # Volumes for data persistence
      - /DATA/AppData/$AppID/pgdata:/var/lib/postgresql/data
    restart: always # Restart policy
    healthcheck: # Health check configuration
      test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
      interval: 5s
      timeout: 5s
      retries: 5
    x-casaos:
      envs:
        - container: POSTGRES_DB
          description:
            en_us: 'Container Variable: POSTGRES_DB'
        - container: POSTGRES_USER
          description:
            en_us: 'Container Variable: POSTGRES_USER'
        - container: POSTGRES_PASSWORD
          description:
            en_us: 'Container Variable: POSTGRES_PASSWORD'
      volumes:
        - container: /var/lib/postgresql/data
          description:
            en_us: 'Container Path: /var/lib/postgresql/data'
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: Umami is a simple, fast, privacy-focused alternative to Google Analytics.
  # Brief tagline for the application
  tagline:
    en_us: Umami is a simple, fast, privacy-focused alternative to Google Analytics.
  # Developer's information
  developer: umami-software
  # Author of this particular configuration
  author: BigBearTechWorld
  # Icon URL for the application
  icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/umami.png
  # Thumbnail image for the application (if any)
  thumbnail: ""
  # Title for the application
  title:
    en_us: Umami
  # Category under which the application falls
  category: BigBearCasaOS
  # Default port mapping for the application
  port_map: "3000"
