github.com/ali-iotechsys/cli@v20.10.0+incompatible/cli/compose/schema/data/config_schema_v3.5.json (about)

     1  {
     2    "$schema": "http://json-schema.org/draft-04/schema#",
     3    "id": "config_schema_v3.5.json",
     4    "type": "object",
     5    "required": ["version"],
     6  
     7    "properties": {
     8      "version": {
     9        "type": "string"
    10      },
    11  
    12      "services": {
    13        "id": "#/properties/services",
    14        "type": "object",
    15        "patternProperties": {
    16          "^[a-zA-Z0-9._-]+$": {
    17            "$ref": "#/definitions/service"
    18          }
    19        },
    20        "additionalProperties": false
    21      },
    22  
    23      "networks": {
    24        "id": "#/properties/networks",
    25        "type": "object",
    26        "patternProperties": {
    27          "^[a-zA-Z0-9._-]+$": {
    28            "$ref": "#/definitions/network"
    29          }
    30        }
    31      },
    32  
    33      "volumes": {
    34        "id": "#/properties/volumes",
    35        "type": "object",
    36        "patternProperties": {
    37          "^[a-zA-Z0-9._-]+$": {
    38            "$ref": "#/definitions/volume"
    39          }
    40        },
    41        "additionalProperties": false
    42      },
    43  
    44      "secrets": {
    45        "id": "#/properties/secrets",
    46        "type": "object",
    47        "patternProperties": {
    48          "^[a-zA-Z0-9._-]+$": {
    49            "$ref": "#/definitions/secret"
    50          }
    51        },
    52        "additionalProperties": false
    53      },
    54  
    55      "configs": {
    56        "id": "#/properties/configs",
    57        "type": "object",
    58        "patternProperties": {
    59          "^[a-zA-Z0-9._-]+$": {
    60            "$ref": "#/definitions/config"
    61          }
    62        },
    63        "additionalProperties": false
    64      }
    65    },
    66  
    67    "patternProperties": {"^x-": {}},
    68    "additionalProperties": false,
    69  
    70    "definitions": {
    71  
    72      "service": {
    73        "id": "#/definitions/service",
    74        "type": "object",
    75  
    76        "properties": {
    77          "deploy": {"$ref": "#/definitions/deployment"},
    78          "build": {
    79            "oneOf": [
    80              {"type": "string"},
    81              {
    82                "type": "object",
    83                "properties": {
    84                  "context": {"type": "string"},
    85                  "dockerfile": {"type": "string"},
    86                  "args": {"$ref": "#/definitions/list_or_dict"},
    87                  "labels": {"$ref": "#/definitions/list_or_dict"},
    88                  "cache_from": {"$ref": "#/definitions/list_of_strings"},
    89                  "network": {"type": "string"},
    90                  "target": {"type": "string"},
    91                  "shm_size": {"type": ["integer", "string"]}
    92                },
    93                "additionalProperties": false
    94              }
    95            ]
    96          },
    97          "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
    98          "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
    99          "cgroup_parent": {"type": "string"},
   100          "command": {
   101            "oneOf": [
   102              {"type": "string"},
   103              {"type": "array", "items": {"type": "string"}}
   104            ]
   105          },
   106          "configs": {
   107            "type": "array",
   108            "items": {
   109              "oneOf": [
   110                {"type": "string"},
   111                {
   112                  "type": "object",
   113                  "properties": {
   114                    "source": {"type": "string"},
   115                    "target": {"type": "string"},
   116                    "uid": {"type": "string"},
   117                    "gid": {"type": "string"},
   118                    "mode": {"type": "number"}
   119                  }
   120                }
   121              ]
   122            }
   123          },
   124          "container_name": {"type": "string"},
   125          "credential_spec": {
   126            "type": "object",
   127            "properties": {
   128              "file": {"type": "string"},
   129              "registry": {"type": "string"}
   130            },
   131            "additionalProperties": false
   132          },
   133          "depends_on": {"$ref": "#/definitions/list_of_strings"},
   134          "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   135          "dns": {"$ref": "#/definitions/string_or_list"},
   136          "dns_search": {"$ref": "#/definitions/string_or_list"},
   137          "domainname": {"type": "string"},
   138          "entrypoint": {
   139            "oneOf": [
   140              {"type": "string"},
   141              {"type": "array", "items": {"type": "string"}}
   142            ]
   143          },
   144          "env_file": {"$ref": "#/definitions/string_or_list"},
   145          "environment": {"$ref": "#/definitions/list_or_dict"},
   146  
   147          "expose": {
   148            "type": "array",
   149            "items": {
   150              "type": ["string", "number"],
   151              "format": "expose"
   152            },
   153            "uniqueItems": true
   154          },
   155  
   156          "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   157          "extra_hosts": {"$ref": "#/definitions/list_or_dict"},
   158          "healthcheck": {"$ref": "#/definitions/healthcheck"},
   159          "hostname": {"type": "string"},
   160          "image": {"type": "string"},
   161          "ipc": {"type": "string"},
   162          "isolation": {"type": "string"},
   163          "labels": {"$ref": "#/definitions/list_or_dict"},
   164          "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   165  
   166          "logging": {
   167              "type": "object",
   168  
   169              "properties": {
   170                  "driver": {"type": "string"},
   171                  "options": {
   172                    "type": "object",
   173                    "patternProperties": {
   174                      "^.+$": {"type": ["string", "number", "null"]}
   175                    }
   176                  }
   177              },
   178              "additionalProperties": false
   179          },
   180  
   181          "mac_address": {"type": "string"},
   182          "network_mode": {"type": "string"},
   183  
   184          "networks": {
   185            "oneOf": [
   186              {"$ref": "#/definitions/list_of_strings"},
   187              {
   188                "type": "object",
   189                "patternProperties": {
   190                  "^[a-zA-Z0-9._-]+$": {
   191                    "oneOf": [
   192                      {
   193                        "type": "object",
   194                        "properties": {
   195                          "aliases": {"$ref": "#/definitions/list_of_strings"},
   196                          "ipv4_address": {"type": "string"},
   197                          "ipv6_address": {"type": "string"}
   198                        },
   199                        "additionalProperties": false
   200                      },
   201                      {"type": "null"}
   202                    ]
   203                  }
   204                },
   205                "additionalProperties": false
   206              }
   207            ]
   208          },
   209          "pid": {"type": ["string", "null"]},
   210  
   211          "ports": {
   212            "type": "array",
   213            "items": {
   214              "oneOf": [
   215                {"type": "number", "format": "ports"},
   216                {"type": "string", "format": "ports"},
   217                {
   218                  "type": "object",
   219                  "properties": {
   220                    "mode": {"type": "string"},
   221                    "target": {"type": "integer"},
   222                    "published": {"type": "integer"},
   223                    "protocol": {"type": "string"}
   224                  },
   225                  "additionalProperties": false
   226                }
   227              ]
   228            },
   229            "uniqueItems": true
   230          },
   231  
   232          "privileged": {"type": "boolean"},
   233          "read_only": {"type": "boolean"},
   234          "restart": {"type": "string"},
   235          "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   236          "shm_size": {"type": ["number", "string"]},
   237          "secrets": {
   238            "type": "array",
   239            "items": {
   240              "oneOf": [
   241                {"type": "string"},
   242                {
   243                  "type": "object",
   244                  "properties": {
   245                    "source": {"type": "string"},
   246                    "target": {"type": "string"},
   247                    "uid": {"type": "string"},
   248                    "gid": {"type": "string"},
   249                    "mode": {"type": "number"}
   250                  }
   251                }
   252              ]
   253            }
   254          },
   255          "sysctls": {"$ref": "#/definitions/list_or_dict"},
   256          "stdin_open": {"type": "boolean"},
   257          "stop_grace_period": {"type": "string", "format": "duration"},
   258          "stop_signal": {"type": "string"},
   259          "tmpfs": {"$ref": "#/definitions/string_or_list"},
   260          "tty": {"type": "boolean"},
   261          "ulimits": {
   262            "type": "object",
   263            "patternProperties": {
   264              "^[a-z]+$": {
   265                "oneOf": [
   266                  {"type": "integer"},
   267                  {
   268                    "type":"object",
   269                    "properties": {
   270                      "hard": {"type": "integer"},
   271                      "soft": {"type": "integer"}
   272                    },
   273                    "required": ["soft", "hard"],
   274                    "additionalProperties": false
   275                  }
   276                ]
   277              }
   278            }
   279          },
   280          "user": {"type": "string"},
   281          "userns_mode": {"type": "string"},
   282          "volumes": {
   283            "type": "array",
   284            "items": {
   285              "oneOf": [
   286                {"type": "string"},
   287                {
   288                  "type": "object",
   289                  "required": ["type"],
   290                  "properties": {
   291                    "type": {"type": "string"},
   292                    "source": {"type": "string"},
   293                    "target": {"type": "string"},
   294                    "read_only": {"type": "boolean"},
   295                    "consistency": {"type": "string"},
   296                    "bind": {
   297                      "type": "object",
   298                      "properties": {
   299                        "propagation": {"type": "string"}
   300                      }
   301                    },
   302                    "volume": {
   303                      "type": "object",
   304                      "properties": {
   305                        "nocopy": {"type": "boolean"}
   306                      }
   307                    }
   308                  },
   309                  "additionalProperties": false
   310                }
   311              ],
   312              "uniqueItems": true
   313            }
   314          },
   315          "working_dir": {"type": "string"}
   316        },
   317        "additionalProperties": false
   318      },
   319  
   320      "healthcheck": {
   321        "id": "#/definitions/healthcheck",
   322        "type": "object",
   323        "additionalProperties": false,
   324        "properties": {
   325          "disable": {"type": "boolean"},
   326          "interval": {"type": "string", "format": "duration"},
   327          "retries": {"type": "number"},
   328          "test": {
   329            "oneOf": [
   330              {"type": "string"},
   331              {"type": "array", "items": {"type": "string"}}
   332            ]
   333          },
   334          "timeout": {"type": "string", "format": "duration"},
   335          "start_period": {"type": "string", "format": "duration"}
   336        }
   337      },
   338      "deployment": {
   339        "id": "#/definitions/deployment",
   340        "type": ["object", "null"],
   341        "properties": {
   342          "mode": {"type": "string"},
   343          "endpoint_mode": {"type": "string"},
   344          "replicas": {"type": "integer"},
   345          "labels": {"$ref": "#/definitions/list_or_dict"},
   346          "update_config": {
   347            "type": "object",
   348            "properties": {
   349              "parallelism": {"type": "integer"},
   350              "delay": {"type": "string", "format": "duration"},
   351              "failure_action": {"type": "string"},
   352              "monitor": {"type": "string", "format": "duration"},
   353              "max_failure_ratio": {"type": "number"},
   354              "order": {"type": "string", "enum": [
   355                "start-first", "stop-first"
   356              ]}
   357            },
   358            "additionalProperties": false
   359          },
   360          "resources": {
   361            "type": "object",
   362            "properties": {
   363              "limits": {
   364                "type": "object",
   365                "properties": {
   366                  "cpus": {"type": "string"},
   367                  "memory": {"type": "string"}
   368                },
   369                "additionalProperties": false
   370              },
   371              "reservations": {
   372                "type": "object",
   373                "properties": {
   374                  "cpus": {"type": "string"},
   375                  "memory": {"type": "string"},
   376                  "generic_resources": {"$ref": "#/definitions/generic_resources"}
   377                },
   378                "additionalProperties": false
   379              }
   380            },
   381            "additionalProperties": false
   382          },
   383          "restart_policy": {
   384            "type": "object",
   385            "properties": {
   386              "condition": {"type": "string"},
   387              "delay": {"type": "string", "format": "duration"},
   388              "max_attempts": {"type": "integer"},
   389              "window": {"type": "string", "format": "duration"}
   390            },
   391            "additionalProperties": false
   392          },
   393          "placement": {
   394            "type": "object",
   395            "properties": {
   396              "constraints": {"type": "array", "items": {"type": "string"}},
   397              "preferences": {
   398                "type": "array",
   399                "items": {
   400                  "type": "object",
   401                  "properties": {
   402                    "spread": {"type": "string"}
   403                  },
   404                  "additionalProperties": false
   405                }
   406              }
   407            },
   408            "additionalProperties": false
   409          }
   410        },
   411        "additionalProperties": false
   412      },
   413  
   414      "generic_resources": {
   415        "id": "#/definitions/generic_resources",
   416        "type": "array",
   417        "items": {
   418          "type": "object",
   419          "properties": {
   420            "discrete_resource_spec": {
   421              "type": "object",
   422              "properties": {
   423                "kind": {"type": "string"},
   424                "value": {"type": "number"}
   425              },
   426              "additionalProperties": false
   427            }
   428          },
   429          "additionalProperties": false
   430        }
   431      },
   432  
   433      "network": {
   434        "id": "#/definitions/network",
   435        "type": ["object", "null"],
   436        "properties": {
   437          "name": {"type": "string"},
   438          "driver": {"type": "string"},
   439          "driver_opts": {
   440            "type": "object",
   441            "patternProperties": {
   442              "^.+$": {"type": ["string", "number"]}
   443            }
   444          },
   445          "ipam": {
   446            "type": "object",
   447            "properties": {
   448              "driver": {"type": "string"},
   449              "config": {
   450                "type": "array",
   451                "items": {
   452                  "type": "object",
   453                  "properties": {
   454                    "subnet": {"type": "string"}
   455                  },
   456                  "additionalProperties": false
   457                }
   458              }
   459            },
   460            "additionalProperties": false
   461          },
   462          "external": {
   463            "type": ["boolean", "object"],
   464            "properties": {
   465              "name": {"type": "string"}
   466            },
   467            "additionalProperties": false
   468          },
   469          "internal": {"type": "boolean"},
   470          "attachable": {"type": "boolean"},
   471          "labels": {"$ref": "#/definitions/list_or_dict"}
   472        },
   473        "additionalProperties": false
   474      },
   475  
   476      "volume": {
   477        "id": "#/definitions/volume",
   478        "type": ["object", "null"],
   479        "properties": {
   480          "name": {"type": "string"},
   481          "driver": {"type": "string"},
   482          "driver_opts": {
   483            "type": "object",
   484            "patternProperties": {
   485              "^.+$": {"type": ["string", "number"]}
   486            }
   487          },
   488          "external": {
   489            "type": ["boolean", "object"],
   490            "properties": {
   491              "name": {"type": "string"}
   492            },
   493            "additionalProperties": false
   494          },
   495          "labels": {"$ref": "#/definitions/list_or_dict"}
   496        },
   497        "additionalProperties": false
   498      },
   499  
   500      "secret": {
   501        "id": "#/definitions/secret",
   502        "type": "object",
   503        "properties": {
   504          "name": {"type": "string"},
   505          "file": {"type": "string"},
   506          "external": {
   507            "type": ["boolean", "object"],
   508            "properties": {
   509              "name": {"type": "string"}
   510            }
   511          },
   512          "labels": {"$ref": "#/definitions/list_or_dict"}
   513        },
   514        "additionalProperties": false
   515      },
   516  
   517      "config": {
   518        "id": "#/definitions/config",
   519        "type": "object",
   520        "properties": {
   521          "name": {"type": "string"},
   522          "file": {"type": "string"},
   523          "external": {
   524            "type": ["boolean", "object"],
   525            "properties": {
   526              "name": {"type": "string"}
   527            }
   528          },
   529          "labels": {"$ref": "#/definitions/list_or_dict"}
   530        },
   531        "additionalProperties": false
   532      },
   533  
   534      "string_or_list": {
   535        "oneOf": [
   536          {"type": "string"},
   537          {"$ref": "#/definitions/list_of_strings"}
   538        ]
   539      },
   540  
   541      "list_of_strings": {
   542        "type": "array",
   543        "items": {"type": "string"},
   544        "uniqueItems": true
   545      },
   546  
   547      "list_or_dict": {
   548        "oneOf": [
   549          {
   550            "type": "object",
   551            "patternProperties": {
   552              ".+": {
   553                "type": ["string", "number", "null"]
   554              }
   555            },
   556            "additionalProperties": false
   557          },
   558          {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
   559        ]
   560      },
   561  
   562      "constraints": {
   563        "service": {
   564          "id": "#/definitions/constraints/service",
   565          "anyOf": [
   566            {"required": ["build"]},
   567            {"required": ["image"]}
   568          ],
   569          "properties": {
   570            "build": {
   571              "required": ["context"]
   572            }
   573          }
   574        }
   575      }
   576    }
   577  }