# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: InfluxDB 2
spec:
    description: Scalable time-series database for metrics, events, and analytics.
    coverImage: https://raw.githubusercontent.com/docker-library/docs/43d87118415bb75d7bb107683e79cd6d69186f67/influxdb/logo.png
    icon: https://avatars.githubusercontent.com/u/5713248?s=200&v=4
    variables:
        - key: PUBLIC_DOMAIN
          type: DOMAIN
          name: Domain
          description: Domain to access your InfluxDB dashboard
        - key: DOCKER_INFLUXDB_INIT_USERNAME
          type: STRING
          name: Username
          description: Initial admin username
        - key: DOCKER_INFLUXDB_INIT_PASSWORD
          type: STRING
          name: Password
          description: Initial admin password (must be between 8–72 characters)
        - key: DOCKER_INFLUXDB_INIT_ORG
          type: STRING
          name: Organization
          description: Default organization name
        - key: DOCKER_INFLUXDB_INIT_BUCKET
          type: STRING
          name: Bucket
          description: Default bucket name
    tags:
        - Database
        - Time-Series
        - Metrics
    readme: "# InfluxDB 2\n\nInfluxDB 2 is a time-series database optimized for storage and real-time queries of metrics and events.  \nIt comes with a built-in UI, powerful query engine (Flux), and integrations with popular data visualization tools.\n\n## Deployment Steps\n1. During deployment, you will be asked to enter:\n   - **Username**\n   - **Password**\n   - **Organization**\n   - **Bucket**\n2. The **Username** and **Password** you set here will also be used to log in to the InfluxDB web UI.\n3. Once deployed, open the dashboard and log in with the same credentials."
    services:
        - name: influxdb
          icon: https://avatars.githubusercontent.com/u/5713248?s=200&v=4
          template: PREBUILT
          spec:
            source:
                image: influxdb:2
            ports:
                - id: web
                  port: 8086
                  type: HTTP
            volumes:
                - id: data
                  dir: /var/lib/influxdb2
                - id: config
                  dir: /etc/influxdb2
            env:
                DOCKER_INFLUXDB_INIT_BUCKET:
                    default: ${DOCKER_INFLUXDB_INIT_BUCKET}
                    expose: true
                DOCKER_INFLUXDB_INIT_MODE:
                    default: setup
                DOCKER_INFLUXDB_INIT_ORG:
                    default: ${DOCKER_INFLUXDB_INIT_ORG}
                    expose: true
                DOCKER_INFLUXDB_INIT_PASSWORD:
                    default: ${DOCKER_INFLUXDB_INIT_PASSWORD}
                    expose: true
                DOCKER_INFLUXDB_INIT_USERNAME:
                    default: ${DOCKER_INFLUXDB_INIT_USERNAME}
                    expose: true
          domainKey: PUBLIC_DOMAIN
localization:
    zh-TW:
        description: 高效能時間序列資料庫，適合儲存與查詢各種指標與事件。
        variables:
            - key: PUBLIC_DOMAIN
              type: DOMAIN
              name: 網域
              description: 訪問 InfluxDB 的網域
            - key: DOCKER_INFLUXDB_INIT_USERNAME
              type: STRING
              name: 管理員帳號
              description: 初始管理員帳號
            - key: DOCKER_INFLUXDB_INIT_PASSWORD
              type: STRING
              name: 管理員密碼
              description: 初始管理員密碼（必須介於 8–72 個字元）
            - key: DOCKER_INFLUXDB_INIT_ORG
              type: STRING
              name: 組織
              description: 預設組織名稱
            - key: DOCKER_INFLUXDB_INIT_BUCKET
              type: STRING
              name: Bucket
              description: 預設資料存放 Bucket
        readme: "# InfluxDB 2\n\nInfluxDB 2 是專為時間序列資料設計的資料庫，適合儲存與即時查詢各類指標與事件。  \n內建操作介面 (UI)、Flux 查詢引擎，並能與多種視覺化工具整合。\n\n## 部署步驟\n1. 在部署時，系統會要求你輸入：\n   - **管理員帳號**\n   - **管理員密碼**\n   - **組織名稱**\n   - **Bucket 名稱**\n2. 你在這裡設定的 **帳號** 與 **密碼**，同時也是登入 InfluxDB 網頁 UI 的憑證。\n3. 部署完成後，請打開瀏覽器並進入 InfluxDB 網頁，使用相同的帳號與密碼登入。"
