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

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