captainVersion: 4
services:
    # HealthChecks
    $$cap_appname:
        image: healthchecks/healthchecks:$$cap_hc_version
        restart: always
        environment:
            DB: postgres
            DB_HOST: srv-captain--$$cap_appname-db
            DB_NAME: hc
            DB_PASSWORD: $$cap_postgres_password
            DB_PORT: 5432
            DB_SSLMODE: prefer
            DB_TARGET_SESSION_ATTRS: read-write
            DB_USER: postgres
            DEBUG: False
            SECRET_KEY: $$cap_gen_random_hex(64)
            SITE_ROOT: http://0.0.0.0:8000
        caproverExtra:
            containerHttpPort: '8000'
    # Postgres
    $$cap_appname-db:
        image: postgres:12
        volumes:
            - $$cap_appname-db-data:/var/lib/postgresql/data
        restart: always
        environment:
            POSTGRES_USER: postgres
            POSTGRES_PASSWORD: $$cap_postgres_password
            POSTGRES_DB: hc
        caproverExtra:
            notExposeAsWebApp: 'true'
caproverOneClickApp:
    variables:
        - id: $$cap_hc_version
          label: hc Manifest digest
          defaultValue: 'v1.25.0'
          description: Find on https://hub.docker.com/r/healthchecks/healthchecks/tags
        - id: $$cap__postgres_password
          label: Postgres Password
          description: Password must be at least 12 characters.  Please use a random string.
          defaultValue: $$cap_gen_random_hex(16)
          validRegex: /^[^\@]{12,}$/
    instructions:
        start: |-
            Healthchecks is a cron job monitoring service. It listens for HTTP requests and email messages ("pings") from your cron jobs and scheduled tasks ("checks"). When a ping does not arrive on time, Healthchecks sends out alerts.
            Github: https://github.com/healthchecks/healthchecks

        end: |-
            Aaaand you're done! 😄
            Your service is available at http://$$cap_appname.$$cap_root_domain
            More environment variables can be found at https://github.com/healthchecks/healthchecks/blob/master/docker/.env
    displayName: 'HealthChecks'
    isOfficial: true
    description: Healthchecks is a cron job monitoring service.
    documentation: https://github.com/healthchecks/healthchecks
