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

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