# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: Grok2API
spec:
    description: One-click deploy Grok2API on Zeabur with the upstream chenyme/grok2api source.
    icon: https://raw.githubusercontent.com/jacob-sheng/grok2api/main/app/statics/favicon.ico
    variables:
        - key: PUBLIC_DOMAIN
          type: DOMAIN
          name: Public Domain
          description: Public Zeabur domain for Grok2API. This value is also written to app.app_url.
        - key: PASSWORD
          type: PASSWORD
          name: Admin and API Password
          description: Reused as both app.app_key and app.api_key for the initial deployment.
    tags:
        - AI
        - API
        - FastAPI
    readme: |-
        # Grok2API on Zeabur

        This template deploys Grok2API on Zeabur with:

        - upstream build source: `chenyme/grok2api@main`
        - local account storage: SQLite under the mounted `/app/data` volume
        - automatic startup overrides for `app.app_key`, `app.api_key`, and `app.app_url`

        After deployment, use the generated domain to access the site, `/admin` for the management UI, and `/v1` as the OpenAI-compatible API base.
    resourceRequirement:
        minConfig:
            cpu: 1
            ram: 1
        recommendedConfig:
            cpu: 2
            ram: 2
    services:
        - name: Grok2API
          icon: https://raw.githubusercontent.com/jacob-sheng/grok2api/main/app/statics/favicon.ico
          template: GIT
          spec:
            id: grok2api
            source:
                source: GITHUB
                repo: 1073538908
                branch: main
            ports:
                - id: web
                  port: 8000
                  type: HTTP
            volumes:
                - id: data
                  dir: /app/data
            instructions:
                - title: Site URL
                  content: https://${PUBLIC_DOMAIN}
                - title: Admin URL
                  content: https://${PUBLIC_DOMAIN}/admin
                - title: API Base
                  content: https://${PUBLIC_DOMAIN}/v1
                - title: Admin Password
                  content: ${PASSWORD}
                - title: API Key
                  content: ${PASSWORD}
                - title: Health Check
                  content: https://${PUBLIC_DOMAIN}/health
            env:
                ACCOUNT_STORAGE:
                    default: local
                    expose: false
                DATA_DIR:
                    default: /app/data
                    expose: false
                GROK_APP_API_KEY:
                    default: ${PASSWORD}
                    expose: false
                GROK_APP_APP_KEY:
                    default: ${PASSWORD}
                    expose: false
                GROK_APP_APP_URL:
                    default: https://${PUBLIC_DOMAIN}
                    expose: false
                LOG_DIR:
                    default: /app/logs
                    expose: false
                LOG_FILE_ENABLED:
                    default: "false"
                    expose: false
                SERVER_HOST:
                    default: 0.0.0.0
                    expose: false
                SERVER_PORT:
                    default: "8000"
                    expose: false
                SERVER_WORKERS:
                    default: "1"
                    expose: false
                TZ:
                    default: Asia/Shanghai
                    expose: false
            healthCheck:
                type: HTTP
                port: web
                http:
                    path: /health
          domainKey: PUBLIC_DOMAIN
