{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://upuai.com.br/schemas/upuai-toml-v1.json",
  "title": "upuai.toml v1",
  "description": "Configuration file for Upuai Cloud services. Declares build, release phase (DB migrations) and deploy options. Doc: https://upuai.com.br/docs/upuai-toml",
  "type": "object",
  "properties": {
    "build": {
      "type": "object",
      "properties": {
        "builder": {
          "type": "string",
          "enum": [
            "railpack",
            "dockerfile"
          ]
        },
        "buildCommand": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048
        },
        "dockerfilePath": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        }
      },
      "additionalProperties": false
    },
    "deploy": {
      "type": "object",
      "properties": {
        "startCommand": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048
        },
        "releaseCommand": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048
        },
        "releaseTimeoutSeconds": {
          "type": "integer",
          "minimum": 10,
          "maximum": 1800
        },
        "healthCheckPath": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        }
      },
      "additionalProperties": false
    },
    "processes": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9_-]{0,62}$"
      },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "command": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          },
          "type": {
            "type": "string",
            "enum": [
              "web",
              "worker",
              "release",
              "clock"
            ]
          },
          "instances": {
            "type": "integer",
            "minimum": 0,
            "maximum": 50
          }
        },
        "required": [
          "command"
        ],
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
