# Configuration for ghost setup

# Application Name
name: big-bear-ghost
# Services used in the application
services:
  # The `app` service for the Ghost application
  app:
    # Name of the container
    container_name: big-bear-ghost
    # Docker image to be used
    image: ghost:6.45.0-alpine
    # Restart policy for the service
    restart: on-failure
    # Networks used by the service
    networks:
      - ghost-network
    environment:
      # Database configuration for Ghost (see Ghost documentation for more details)
      database__client: mysql
      database__connection__host: db
      database__connection__user: ghost
      database__connection__password: casaos
      database__connection__database: ghost
      # Base URL for the Ghost application
      url: "http://localhost:2368"
      # Note on NODE_ENV default value for this image
      #NODE_ENV: development
    # Volume mappings for persistent storage
    volumes:
      - /DATA/AppData/$AppID/content:/var/lib/ghost/content
    # Port mappings for the service
    ports:
      - 2368:2368
    # Dependencies for the service
    depends_on:
      - db
    x-casaos:
      envs:
        - container: database__client
          description:
            en_us: 'Container Variable: database__client'
        - container: database__connection__host
          description:
            en_us: 'Container Variable: database__connection__host'
        - container: database__connection__user
          description:
            en_us: 'Container Variable: database__connection__user'
        - container: database__connection__password
          description:
            en_us: 'Container Variable: database__connection__password'
        - container: database__connection__database
          description:
            en_us: 'Container Variable: database__connection__database'
        - container: url
          description:
            en_us: 'Container Variable: url'
      volumes:
        - container: /var/lib/ghost/content
          description:
            en_us: 'Container Path: /var/lib/ghost/content'
      ports:
        - container: "2368"
          description:
            en_us: 'Container Port: 2368'
  # The `db` service for database (MySQL in this case)
  db:
    # Container name
    container_name: big-bear-ghost-db
    # Docker image to be used
    image: mysql:8.0
    # Restart policy for the service
    restart: on-failure
    # Volume mappings for persistent storage
    volumes:
      - /DATA/AppData/$AppID/mysql:/var/lib/mysql
    # MySQL environment variables
    environment:
      MYSQL_USER: "ghost"
      MYSQL_DATABASE: "ghost"
      MYSQL_PASSWORD: "casaos"
      MYSQL_ROOT_PASSWORD: "casaos"
    # Networks used by the service
    networks:
      - ghost-network
    x-casaos:
      envs:
        - container: MYSQL_USER
          description:
            en_us: 'Container Variable: MYSQL_USER'
        - container: MYSQL_DATABASE
          description:
            en_us: 'Container Variable: MYSQL_DATABASE'
        - container: MYSQL_PASSWORD
          description:
            en_us: 'Container Variable: MYSQL_PASSWORD'
        - container: MYSQL_ROOT_PASSWORD
          description:
            en_us: 'Container Variable: MYSQL_ROOT_PASSWORD'
      volumes:
        - container: /var/lib/mysql
          description:
            en_us: 'Container Path: /var/lib/mysql'
# Networks used by the application
networks:
  # Define the network for AdGuard Home
  ghost-network:
    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: Ghost is a free and open source blogging platform written in JavaScript and distributed under the MIT License, designed to simplify the process of online publishing for individual bloggers as well as online publications.
  # Brief tagline for the application
  tagline:
    en_us: Ghost is a free and open source blogging platform
  # Developer's information
  developer: ghost
  # Author of this particular configuration
  author: BigBearTechWorld
  # Icon URL for the application
  icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/ghost.png
  # Thumbnail image for the application (if any)
  thumbnail: ""
  # Installation tips
  tips:
    before_install:
      en_us: |
        Update the url environment variable to reflect your CasaOS IP address.
  # Title for the application
  title:
    en_us: Ghost
  # Category under which the application falls
  category: BigBearCasaOS
  # Default port mapping for the application
  port_map: "2368"
