# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: systemprompt
spec:
    description: Self-owned AI control plane — governance gateway for Claude, OpenAI, and Gemini with audit, policy, and MCP orchestration.
    icon: https://raw.githubusercontent.com/systempromptio/systemprompt-template/main/storage/files/images/icon-256.png
    variables:
        - key: PUBLIC_DOMAIN
          type: DOMAIN
          name: Domain
          description: Public domain for the gateway.
        - key: ANTHROPIC_API_KEY
          type: STRING
          name: Anthropic API key
          description: At least one AI provider key (Anthropic, OpenAI, or Gemini) is required. Leave unused providers blank.
        - key: OPENAI_API_KEY
          type: STRING
          name: OpenAI API key (optional)
          description: Optional.
        - key: GEMINI_API_KEY
          type: STRING
          name: Gemini API key (optional)
          description: Optional.
    tags:
        - AI
        - Tool
    readme: |-
        # systemprompt
        Governance gateway for AI providers (Claude, OpenAI, Gemini): policy
        checks, secret scanning, audit trails, rate limits, and MCP orchestration,
        backed by Postgres.

        At least one AI provider API key is required. First boot runs database
        migrations and a publish pipeline — allow several minutes before the
        service reports healthy.

        Docs: https://systemprompt.io/documentation/?utm_source=zeabur&utm_medium=template
    services:
        - name: postgres
          icon: https://raw.githubusercontent.com/zeabur/service-icons/main/marketplace/postgresql.svg
          template: PREBUILT
          spec:
            id: postgres
            source:
                image: postgres:18-alpine
            ports:
                - id: database
                  port: 5432
                  type: TCP
            volumes:
                - id: data
                  dir: /var/lib/postgresql
            instructions:
                - title: Database
                  content: Internal Postgres for the gateway.
            env:
                POSTGRES_DB:
                    default: systemprompt
                    expose: true
                POSTGRES_PASSWORD:
                    default: ${PASSWORD}
                    expose: true
                POSTGRES_USER:
                    default: systemprompt
                    expose: true
        - name: gateway
          icon: https://raw.githubusercontent.com/systempromptio/systemprompt-template/main/storage/files/images/icon-256.png
          template: PREBUILT
          spec:
            id: gateway
            source:
                image: ghcr.io/systempromptio/systemprompt-template:0
            ports:
                - id: web
                  port: 8080
                  type: HTTP
            instructions:
                - title: Gateway
                  content: ${ZEABUR_WEB_URL}
                - title: First boot
                  content: Migrations and the publish pipeline run on first start — allow several minutes before /api/v1/health returns 200.
            env:
                ANTHROPIC_API_KEY:
                    default: ${ANTHROPIC_API_KEY}
                DATABASE_URL:
                    default: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres.zeabur.internal:5432/${POSTGRES_DB}
                EXTERNAL_URL:
                    default: ${ZEABUR_WEB_URL}
                GEMINI_API_KEY:
                    default: ${GEMINI_API_KEY}
                HOST:
                    default: 0.0.0.0
                OPENAI_API_KEY:
                    default: ${OPENAI_API_KEY}
                PORT:
                    default: "8080"
          domainKey: PUBLIC_DOMAIN
