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

     1  {
     2    "$schema": "http://json-schema.org/draft-04/schema#",
     3    "id": "config_schema_v3.8.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              "config": {"type": "string"},
   129              "file": {"type": "string"},
   130              "registry": {"type": "string"}
   131            },
   132            "additionalProperties": false
   133          },
   134          "depends_on": {"$ref": "#/definitions/list_of_strings"},
   135          "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   136          "dns": {"$ref": "#/definitions/string_or_list"},
   137          "dns_search": {"$ref": "#/definitions/string_or_list"},
   138          "domainname": {"type": "string"},
   139          "entrypoint": {
   140            "oneOf": [
   141              {"type": "string"},
   142              {"type": "array", "items": {"type": "string"}}
   143            ]
   144          },
   145          "env_file": {"$ref": "#/definitions/string_or_list"},
   146          "environment": {"$ref": "#/definitions/list_or_dict"},
   147  
   148          "expose": {
   149            "type": "array",
   150            "items": {
   151              "type": ["string", "number"],
   152              "format": "expose"
   153            },
   154            "uniqueItems": true
   155          },
   156  
   157          "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   158          "extra_hosts": {"$ref": "#/definitions/list_or_dict"},
   159          "healthcheck": {"$ref": "#/definitions/healthcheck"},
   160          "hostname": {"type": "string"},
   161          "image": {"type": "string"},
   162          "init": {"type": "boolean"},
   163          "ipc": {"type": "string"},
   164          "isolation": {"type": "string"},
   165          "labels": {"$ref": "#/definitions/list_or_dict"},
   166          "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   167  
   168          "logging": {
   169              "type": "object",
   170  
   171              "properties": {
   172                  "driver": {"type": "string"},
   173                  "options": {
   174                    "type": "object",
   175                    "patternProperties": {
   176                      "^.+$": {"type": ["string", "number", "null"]}
   177                    }
   178                  }
   179              },
   180              "additionalProperties": false
   181          },
   182  
   183          "mac_address": {"type": "string"},
   184          "network_mode": {"type": "string"},
   185  
   186          "networks": {
   187            "oneOf": [
   188              {"$ref": "#/definitions/list_of_strings"},
   189              {
   190                "type": "object",
   191                "patternProperties": {
   192                  "^[a-zA-Z0-9._-]+$": {
   193                    "oneOf": [
   194                      {
   195                        "type": "object",
   196                        "properties": {
   197                          "aliases": {"$ref": "#/definitions/list_of_strings"},
   198                          "ipv4_address": {"type": "string"},
   199                          "ipv6_address": {"type": "string"}
   200                        },
   201                        "additionalProperties": false
   202                      },
   203                      {"type": "null"}
   204                    ]
   205                  }
   206                },
   207                "additionalProperties": false
   208              }
   209            ]
   210          },
   211          "pid": {"type": ["string", "null"]},
   212  
   213          "ports": {
   214            "type": "array",
   215            "items": {
   216              "oneOf": [
   217                {"type": "number", "format": "ports"},
   218                {"type": "string", "format": "ports"},
   219                {
   220                  "type": "object",
   221                  "properties": {
   222                    "mode": {"type": "string"},
   223                    "target": {"type": "integer"},
   224                    "published": {"type": "integer"},
   225                    "protocol": {"type": "string"}
   226                  },
   227                  "additionalProperties": false
   228                }
   229              ]
   230            },
   231            "uniqueItems": true
   232          },
   233  
   234          "privileged": {"type": "boolean"},
   235          "read_only": {"type": "boolean"},
   236          "restart": {"type": "string"},
   237          "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   238          "shm_size": {"type": ["number", "string"]},
   239          "secrets": {
   240            "type": "array",
   241            "items": {
   242              "oneOf": [
   243                {"type": "string"},
   244                {
   245                  "type": "object",
   246                  "properties": {
   247                    "source": {"type": "string"},
   248                    "target": {"type": "string"},
   249                    "uid": {"type": "string"},
   250                    "gid": {"type": "string"},
   251                    "mode": {"type": "number"}
   252                  }
   253                }
   254              ]
   255            }
   256          },
   257          "sysctls": {"$ref": "#/definitions/list_or_dict"},
   258          "stdin_open": {"type": "boolean"},
   259          "stop_grace_period": {"type": "string", "format": "duration"},
   260          "stop_signal": {"type": "string"},
   261          "tmpfs": {"$ref": "#/definitions/string_or_list"},
   262          "tty": {"type": "boolean"},
   263          "ulimits": {
   264            "type": "object",
   265            "patternProperties": {
   266              "^[a-z]+$": {
   267                "oneOf": [
   268                  {"type": "integer"},
   269                  {
   270                    "type":"object",
   271                    "properties": {
   272                      "hard": {"type": "integer"},
   273                      "soft": {"type": "integer"}
   274                    },
   275                    "required": ["soft", "hard"],
   276                    "additionalProperties": false
   277                  }
   278                ]
   279              }
   280            }
   281          },
   282          "user": {"type": "string"},
   283          "userns_mode": {"type": "string"},
   284          "volumes": {
   285            "type": "array",
   286            "items": {
   287              "oneOf": [
   288                {"type": "string"},
   289                {
   290                  "type": "object",
   291                  "required": ["type"],
   292                  "properties": {
   293                    "type": {"type": "string"},
   294                    "source": {"type": "string"},
   295                    "target": {"type": "string"},
   296                    "read_only": {"type": "boolean"},
   297                    "consistency": {"type": "string"},
   298                    "bind": {
   299                      "type": "object",
   300                      "properties": {
   301                        "propagation": {"type": "string"}
   302                      }
   303                    },
   304                    "volume": {
   305                      "type": "object",
   306                      "properties": {
   307                        "nocopy": {"type": "boolean"}
   308                      }
   309                    },
   310                    "tmpfs": {
   311                      "type": "object",
   312                      "properties": {
   313                        "size": {
   314                          "type": "integer",
   315                          "minimum": 0
   316                        }
   317                      }
   318                    }
   319                  },
   320                  "additionalProperties": false
   321                }
   322              ],
   323              "uniqueItems": true
   324            }
   325          },
   326          "working_dir": {"type": "string"}
   327        },
   328        "patternProperties": {"^x-": {}},
   329        "additionalProperties": false
   330      },
   331  
   332      "healthcheck": {
   333        "id": "#/definitions/healthcheck",
   334        "type": "object",
   335        "additionalProperties": false,
   336        "properties": {
   337          "disable": {"type": "boolean"},
   338          "interval": {"type": "string", "format": "duration"},
   339          "retries": {"type": "number"},
   340          "test": {
   341            "oneOf": [
   342              {"type": "string"},
   343              {"type": "array", "items": {"type": "string"}}
   344            ]
   345          },
   346          "timeout": {"type": "string", "format": "duration"},
   347          "start_period": {"type": "string", "format": "duration"}
   348        }
   349      },
   350      "deployment": {
   351        "id": "#/definitions/deployment",
   352        "type": ["object", "null"],
   353        "properties": {
   354          "mode": {"type": "string"},
   355          "endpoint_mode": {"type": "string"},
   356          "replicas": {"type": "integer"},
   357          "labels": {"$ref": "#/definitions/list_or_dict"},
   358          "rollback_config": {
   359            "type": "object",
   360            "properties": {
   361              "parallelism": {"type": "integer"},
   362              "delay": {"type": "string", "format": "duration"},
   363              "failure_action": {"type": "string"},
   364              "monitor": {"type": "string", "format": "duration"},
   365              "max_failure_ratio": {"type": "number"},
   366              "order": {"type": "string", "enum": [
   367                "start-first", "stop-first"
   368              ]}
   369            },
   370            "additionalProperties": false
   371          },
   372          "update_config": {
   373            "type": "object",
   374            "properties": {
   375              "parallelism": {"type": "integer"},
   376              "delay": {"type": "string", "format": "duration"},
   377              "failure_action": {"type": "string"},
   378              "monitor": {"type": "string", "format": "duration"},
   379              "max_failure_ratio": {"type": "number"},
   380              "order": {"type": "string", "enum": [
   381                "start-first", "stop-first"
   382              ]}
   383            },
   384            "additionalProperties": false
   385          },
   386          "resources": {
   387            "type": "object",
   388            "properties": {
   389              "limits": {
   390                "type": "object",
   391                "properties": {
   392                  "cpus": {"type": "string"},
   393                  "memory": {"type": "string"}
   394                },
   395                "additionalProperties": false
   396              },
   397              "reservations": {
   398                "type": "object",
   399                "properties": {
   400                  "cpus": {"type": "string"},
   401                  "memory": {"type": "string"},
   402                  "generic_resources": {"$ref": "#/definitions/generic_resources"}
   403                },
   404                "additionalProperties": false
   405              }
   406            },
   407            "additionalProperties": false
   408          },
   409          "restart_policy": {
   410            "type": "object",
   411            "properties": {
   412              "condition": {"type": "string"},
   413              "delay": {"type": "string", "format": "duration"},
   414              "max_attempts": {"type": "integer"},
   415              "window": {"type": "string", "format": "duration"}
   416            },
   417            "additionalProperties": false
   418          },
   419          "placement": {
   420            "type": "object",
   421            "properties": {
   422              "constraints": {"type": "array", "items": {"type": "string"}},
   423              "preferences": {
   424                "type": "array",
   425                "items": {
   426                  "type": "object",
   427                  "properties": {
   428                    "spread": {"type": "string"}
   429                  },
   430                  "additionalProperties": false
   431                }
   432              },
   433              "max_replicas_per_node": {"type": "integer"}
   434            },
   435            "additionalProperties": false
   436          }
   437        },
   438        "additionalProperties": false
   439      },
   440  
   441      "generic_resources": {
   442        "id": "#/definitions/generic_resources",
   443        "type": "array",
   444        "items": {
   445          "type": "object",
   446          "properties": {
   447            "discrete_resource_spec": {
   448              "type": "object",
   449              "properties": {
   450                "kind": {"type": "string"},
   451                "value": {"type": "number"}
   452              },
   453              "additionalProperties": false
   454            }
   455          },
   456          "additionalProperties": false
   457        }
   458      },
   459  
   460      "network": {
   461        "id": "#/definitions/network",
   462        "type": ["object", "null"],
   463        "properties": {
   464          "name": {"type": "string"},
   465          "driver": {"type": "string"},
   466          "driver_opts": {
   467            "type": "object",
   468            "patternProperties": {
   469              "^.+$": {"type": ["string", "number"]}
   470            }
   471          },
   472          "ipam": {
   473            "type": "object",
   474            "properties": {
   475              "driver": {"type": "string"},
   476              "config": {
   477                "type": "array",
   478                "items": {
   479                  "type": "object",
   480                  "properties": {
   481                    "subnet": {"type": "string"}
   482                  },
   483                  "additionalProperties": false
   484                }
   485              }
   486            },
   487            "additionalProperties": false
   488          },
   489          "external": {
   490            "type": ["boolean", "object"],
   491            "properties": {
   492              "name": {"type": "string"}
   493            },
   494            "additionalProperties": false
   495          },
   496          "internal": {"type": "boolean"},
   497          "attachable": {"type": "boolean"},
   498          "labels": {"$ref": "#/definitions/list_or_dict"}
   499        },
   500        "patternProperties": {"^x-": {}},
   501        "additionalProperties": false
   502      },
   503  
   504      "volume": {
   505        "id": "#/definitions/volume",
   506        "type": ["object", "null"],
   507        "properties": {
   508          "name": {"type": "string"},
   509          "driver": {"type": "string"},
   510          "driver_opts": {
   511            "type": "object",
   512            "patternProperties": {
   513              "^.+$": {"type": ["string", "number"]}
   514            }
   515          },
   516          "external": {
   517            "type": ["boolean", "object"],
   518            "properties": {
   519              "name": {"type": "string"}
   520            },
   521            "additionalProperties": false
   522          },
   523          "labels": {"$ref": "#/definitions/list_or_dict"}
   524        },
   525        "patternProperties": {"^x-": {}},
   526        "additionalProperties": false
   527      },
   528  
   529      "secret": {
   530        "id": "#/definitions/secret",
   531        "type": "object",
   532        "properties": {
   533          "name": {"type": "string"},
   534          "file": {"type": "string"},
   535          "external": {
   536            "type": ["boolean", "object"],
   537            "properties": {
   538              "name": {"type": "string"}
   539            }
   540          },
   541          "labels": {"$ref": "#/definitions/list_or_dict"},
   542          "driver": {"type": "string"},
   543          "driver_opts": {
   544            "type": "object",
   545            "patternProperties": {
   546              "^.+$": {"type": ["string", "number"]}
   547            }
   548          },
   549          "template_driver": {"type": "string"}
   550        },
   551        "patternProperties": {"^x-": {}},
   552        "additionalProperties": false
   553      },
   554  
   555      "config": {
   556        "id": "#/definitions/config",
   557        "type": "object",
   558        "properties": {
   559          "name": {"type": "string"},
   560          "file": {"type": "string"},
   561          "external": {
   562            "type": ["boolean", "object"],
   563            "properties": {
   564              "name": {"type": "string"}
   565            }
   566          },
   567          "labels": {"$ref": "#/definitions/list_or_dict"},
   568          "template_driver": {"type": "string"}
   569        },
   570        "patternProperties": {"^x-": {}},
   571        "additionalProperties": false
   572      },
   573  
   574      "string_or_list": {
   575        "oneOf": [
   576          {"type": "string"},
   577          {"$ref": "#/definitions/list_of_strings"}
   578        ]
   579      },
   580  
   581      "list_of_strings": {
   582        "type": "array",
   583        "items": {"type": "string"},
   584        "uniqueItems": true
   585      },
   586  
   587      "list_or_dict": {
   588        "oneOf": [
   589          {
   590            "type": "object",
   591            "patternProperties": {
   592              ".+": {
   593                "type": ["string", "number", "null"]
   594              }
   595            },
   596            "additionalProperties": false
   597          },
   598          {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
   599        ]
   600      },
   601  
   602      "constraints": {
   603        "service": {
   604          "id": "#/definitions/constraints/service",
   605          "anyOf": [
   606            {"required": ["build"]},
   607            {"required": ["image"]}
   608          ],
   609          "properties": {
   610            "build": {
   611              "required": ["context"]
   612            }
   613          }
   614        }
   615      }
   616    }
   617  }