# Configuration for tandoor setup

# Name of the big-bear-tandoor application
name: big-bear-tandoor
# Service definitions for the big-bear-tandoor application
services:
  # Service name: big-bear-tandoor
  # The `big-bear-tandoor` service definition
  big-bear-tandoor:
    # Name of the container
    container_name: big-bear-tandoor
    # Image to be used for the container
    image: ghcr.io/tandoorrecipes/recipes:2.6.9
    # Container restart policy
    restart: unless-stopped
    # Volumes to be mounted to the container
    volumes:
      - /DATA/AppData/$AppID/staticfiles:/opt/recipes/staticfiles
      - /DATA/AppData/$AppID/mediafiles:/opt/recipes/mediafiles
    # Ports mapping between host and container
    ports:
      # Mapping port 8080 of the host to port 8080 of the container
      - "8080:8080"
    # Environment variables to be passed to the container
    environment:
      - SECRET_KEY=6496f725-e4a4-4fa5-9f7b-db0114bc1568
      - DB_ENGINE=django.db.backends.postgresql
      - POSTGRES_HOST=big-bear-tandoor-db
      - POSTGRES_PORT=5432
      - POSTGRES_USER=tandoor
      - POSTGRES_PASSWORD=100c7d31-9ec5-44ec-9101-e226c8e2420d
      - POSTGRES_DB=tandoordb
    # Network to be used by the container
    networks:
      - big_bear_tandoor_network
    # Healthcheck configuration for the container
    depends_on:
      big-bear-tandoor-db:
        condition: service_healthy
    x-casaos:
      envs:
        - container: SECRET_KEY
          description:
            en_us: 'Container Variable: SECRET_KEY'
        - container: DB_ENGINE
          description:
            en_us: 'Container Variable: DB_ENGINE'
        - container: POSTGRES_HOST
          description:
            en_us: 'Container Variable: POSTGRES_HOST'
        - container: POSTGRES_PORT
          description:
            en_us: 'Container Variable: POSTGRES_PORT'
        - container: POSTGRES_USER
          description:
            en_us: 'Container Variable: POSTGRES_USER'
        - container: POSTGRES_PASSWORD
          description:
            en_us: 'Container Variable: POSTGRES_PASSWORD'
        - container: POSTGRES_DB
          description:
            en_us: 'Container Variable: POSTGRES_DB'
      volumes:
        - container: /opt/recipes/staticfiles
          description:
            en_us: 'Container Path: /opt/recipes/staticfiles'
        - container: /opt/recipes/mediafiles
          description:
            en_us: 'Container Path: /opt/recipes/mediafiles'
      ports:
        - container: "8080"
          description:
            en_us: 'Container Port: 8080'
  big-bear-tandoor-db:
    image: postgres:15-alpine
    container_name: big-bear-tandoor-db
    volumes:
      - /DATA/AppData/$AppID/postgresql:/var/lib/postgresql/data
    environment:
      - POSTGRES_PORT=5432
      - POSTGRES_USER=tandoor
      - POSTGRES_PASSWORD=100c7d31-9ec5-44ec-9101-e226c8e2420d
      - POSTGRES_DB=tandoordb
    restart: unless-stopped
    networks:
      - big_bear_tandoor_network
    healthcheck:
      test: ["CMD-SHELL", "pg_isready", "-d", "tandoor"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 30s
    x-casaos:
      envs:
        - container: POSTGRES_PORT
          description:
            en_us: 'Container Variable: POSTGRES_PORT'
        - container: POSTGRES_USER
          description:
            en_us: 'Container Variable: POSTGRES_USER'
        - container: POSTGRES_PASSWORD
          description:
            en_us: 'Container Variable: POSTGRES_PASSWORD'
        - container: POSTGRES_DB
          description:
            en_us: 'Container Variable: POSTGRES_DB'
      volumes:
        - container: /var/lib/postgresql/data
          description:
            en_us: 'Container Path: /var/lib/postgresql/data'
# Network definitions for the big-bear-tandoor application
networks:
  big_bear_tandoor_network:
    driver: bridge
x-casaos:
  # Supported CPU architectures for this application
  architectures:
    - amd64
    - arm64
  # Main service for this application
  main: big-bear-tandoor
  # Detailed description for the application
  description:
    en_us: Drop your collection of links and notes. Get Tandoor and never look back onto a time without recipe management, storage, sharing and collaborative cooking!
  # Brief tagline for the application
  tagline:
    en_us: Recipe collection manager.
  # Developer's information
  developer: tandoorrecipes
  # Author of this particular configuration
  author: BigBearTechWorld
  # Icon URL for the application
  icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/tandoor-recipes.png
  # Thumbnail image for the application (if any)
  thumbnail: ""
  # Title for the application
  title:
    en_us: Tandoor
  # Category under which the application falls
  category: BigBearCasaOS
  # Default port mapping for the application
  port_map: "8080"
