captainVersion: 4
services:
    $$cap_appname-db:
        image: postgres:$$cap_postgres_version
        volumes:
            - $$cap_appname-db-data:/var/lib/postgresql/data
        restart: always
        environment:
            POSTGRES_USER: miniflux
            POSTGRES_PASSWORD: $$cap_postgres_password
            POSTGRES_DB: miniflux
        caproverExtra:
            notExposeAsWebApp: 'true'
    $$cap_appname:
        image: miniflux/miniflux:$$cap_miniflux_version
        depends_on:
            - $$cap_appname-db
        restart: always
        environment:
            DATABASE_URL: postgres://miniflux:$$cap_postgres_password@srv-captain--$$cap_appname-db/miniflux?sslmode=disable
            RUN_MIGRATIONS: '1'
            CREATE_ADMIN: '1'
            ADMIN_USERNAME: $$cap_admin_user
            ADMIN_PASSWORD: $$cap_admin_password
        caproverExtra:
            containerHttpPort: '8080'
caproverOneClickApp:
    variables:
        - id: $$cap_miniflux_version
          label: Miniflux version
          defaultValue: 2.0.22
          description: Checkout valid tags at https://hub.docker.com/r/miniflux/miniflux/tags
        - id: $$cap_admin_user
          label: Admin user
        - id: $$cap_admin_password
          label: Admin Password
          defaultValue: $$cap_gen_random_hex(10)
        - id: $$cap_postgres_version
          label: Postgres Version
          defaultValue: 9.6.18-alpine
          description: Checkout their docker page for the valid tags https://hub.docker.com/r/library/postgres/tags/
          validRegex: /^([^\s^\/])+$/
        - id: $$cap_postgres_password
          label: Postgres Password
          defaultValue: $$cap_gen_random_hex(10)
          description: ''
          validRegex: /.{1,}/
    instructions:
        start: Miniflux is a minimalist and opinionated feed reader.
        end: Miniflux is deployed and the dashboard is available from http://$$cap_appname.$$cap_root_domain.
    displayName: Miniflux
    isOfficial: true
    description: Self hosted RSS server
    documentation: https://miniflux.app/docs/index.html
