captainVersion: 4
services:
    $$cap_appname-postgres:
        image: postgres:$$cap_postgres_version
        environment:
            POSTGRES_DB: wiki
            POSTGRES_PASSWORD: $$cap_DB_PASS
            POSTGRES_USER: wikijs
        volumes:
            - $$cap_appname-db-data:/var/lib/postgresql/data
    $$cap_appname:
        environment:
            DB_TYPE: postgres
            DB_HOST: srv-captain--$$cap_appname-postgres
            DB_PORT: '5432'
            DB_USER: wikijs
            DB_PASS: $$cap_DB_PASS
            DB_NAME: wiki
        image: requarks/wiki:$$cap_version
        restart: always
        caproverExtra:
            containerHttpPort: '3000'
caproverOneClickApp:
    variables:
        - label: Wiki.js Version
          defaultValue: '2.5'
          description: It's highly recommended that you don't use the latest tag but instead the major version you need, e.g. requarks/wiki:2
          id: $$cap_version
        - label: Postgres Version
          defaultValue: 14.1-alpine
          id: $$cap_postgres_version
        - label: Database Password
          description: Password to connect to the database
          defaultValue: daTaBaSePaSsWorD
          id: $$cap_DB_PASS
    instructions:
        end: >
            Wiki.js is deployed and available as $$cap_appname. 

            IMPORTANT: It will take up to 2 minutes for Wiki.js to be ready. Before that, you might see 502 error page.
        start: Wiki.js is a fully open source, adaptable platform for building and running a Wiki.
    displayName: wiki.js
    isOfficial: true
    description: The most powerful and extensible open source Wiki software
    documentation: https://docs.requarks.io/
