captainVersion: 4
services:
    $$cap_appname-db:
        image: mysql:$$cap_mysql_version
        restart: always
        environment:
            MYSQL_ROOT_PASSWORD: $$cap_db_pass
        volumes:
            - $$cap_appname-db-data:/var/lib/mysql
        caproverExtra:
            notExposeAsWebApp: 'true'
    $$cap_appname:
        image: prismagraphql/prisma:$$cap_prisma_version
        restart: always
        ports:
            - 4466:4466
        depends_on:
            - $$cap_appname-db
        environment:
            PRISMA_CONFIG: >
                managementApiSecret: $$cap_management_secret

                port: 4466

                databases:
                  default:
                    connector: mysql
                    host: srv-captain--$$cap_appname-db
                    port: 3306
                    user: root
                    password: $$cap_db_pass
                    migrations: true
        caproverExtra:
            containerHttpPort: '4466'
caproverOneClickApp:
    variables:
        - id: $$cap_prisma_version
          label: Prisma 1 Version
          defaultValue: '1.29'
          description: Check out their GitHub page for their latest version https://github.com/prisma/prisma1
          validRegex: /^([^\s^\/])+$/
        - id: $$cap_mysql_version
          label: MySQL Version
          defaultValue: '5.7'
          description: Check out their Docker page for the valid tags https://hub.docker.com/r/library/mysql/tags/
          validRegex: /^([^\s^\/])+$/
        - id: $$cap_db_pass
          label: Database password
          description: ''
          validRegex: /.{1,}/
        - id: $$cap_management_secret
          label: Prisma 1 Management API secret
          description: To ensure only entitled users are able to perform actions through the Management API. Minimum 10 characters, at least one letter and one number.
          validRegex: /^(?=.*\d).{10,}$/
    instructions:
        end: Prisma 1 is deployed and available as $$cap_appname.
        start: Prisma 1 - Database tools for modern application development. This setup runs Prisma 1 along with a MySQL Database.
    displayName: ''
    isOfficial: true
    description: Prisma 1 is a database abstraction layer that turns your databases into GraphQL APIs with CRUD operations and realtime capabilities
    documentation: Taken from https://hub.docker.com/r/prismagraphql/prisma/
