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

     1  {
     2    "$schema": "http://json-schema.org/draft-04/schema#",
     3    "id": "config_schema_v3.2.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  
    56    "additionalProperties": false,
    57  
    58    "definitions": {
    59  
    60      "service": {
    61        "id": "#/definitions/service",
    62        "type": "object",
    63  
    64        "properties": {
    65          "deploy": {"$ref": "#/definitions/deployment"},
    66          "build": {
    67            "oneOf": [
    68              {"type": "string"},
    69              {
    70                "type": "object",
    71                "properties": {
    72                  "context": {"type": "string"},
    73                  "dockerfile": {"type": "string"},
    74                  "args": {"$ref": "#/definitions/list_or_dict"},
    75                  "cache_from": {"$ref": "#/definitions/list_of_strings"}
    76                },
    77                "additionalProperties": false
    78              }
    79            ]
    80          },
    81          "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
    82          "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
    83          "cgroup_parent": {"type": "string"},
    84          "command": {
    85            "oneOf": [
    86              {"type": "string"},
    87              {"type": "array", "items": {"type": "string"}}
    88            ]
    89          },
    90          "container_name": {"type": "string"},
    91          "depends_on": {"$ref": "#/definitions/list_of_strings"},
    92          "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
    93          "dns": {"$ref": "#/definitions/string_or_list"},
    94          "dns_search": {"$ref": "#/definitions/string_or_list"},
    95          "domainname": {"type": "string"},
    96          "entrypoint": {
    97            "oneOf": [
    98              {"type": "string"},
    99              {"type": "array", "items": {"type": "string"}}
   100            ]
   101          },
   102          "env_file": {"$ref": "#/definitions/string_or_list"},
   103          "environment": {"$ref": "#/definitions/list_or_dict"},
   104  
   105          "expose": {
   106            "type": "array",
   107            "items": {
   108              "type": ["string", "number"],
   109              "format": "expose"
   110            },
   111            "uniqueItems": true
   112          },
   113  
   114          "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   115          "extra_hosts": {"$ref": "#/definitions/list_or_dict"},
   116          "healthcheck": {"$ref": "#/definitions/healthcheck"},
   117          "hostname": {"type": "string"},
   118          "image": {"type": "string"},
   119          "ipc": {"type": "string"},
   120          "labels": {"$ref": "#/definitions/list_or_dict"},
   121          "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   122  
   123          "logging": {
   124              "type": "object",
   125  
   126              "properties": {
   127                  "driver": {"type": "string"},
   128                  "options": {
   129                    "type": "object",
   130                    "patternProperties": {
   131                      "^.+$": {"type": ["string", "number", "null"]}
   132                    }
   133                  }
   134              },
   135              "additionalProperties": false
   136          },
   137  
   138          "mac_address": {"type": "string"},
   139          "network_mode": {"type": "string"},
   140  
   141          "networks": {
   142            "oneOf": [
   143              {"$ref": "#/definitions/list_of_strings"},
   144              {
   145                "type": "object",
   146                "patternProperties": {
   147                  "^[a-zA-Z0-9._-]+$": {
   148                    "oneOf": [
   149                      {
   150                        "type": "object",
   151                        "properties": {
   152                          "aliases": {"$ref": "#/definitions/list_of_strings"},
   153                          "ipv4_address": {"type": "string"},
   154                          "ipv6_address": {"type": "string"}
   155                        },
   156                        "additionalProperties": false
   157                      },
   158                      {"type": "null"}
   159                    ]
   160                  }
   161                },
   162                "additionalProperties": false
   163              }
   164            ]
   165          },
   166          "pid": {"type": ["string", "null"]},
   167  
   168          "ports": {
   169            "type": "array",
   170            "items": {
   171              "oneOf": [
   172                {"type": "number", "format": "ports"},
   173                {"type": "string", "format": "ports"},
   174                {
   175                  "type": "object",
   176                  "properties": {
   177                    "mode": {"type": "string"},
   178                    "target": {"type": "integer"},
   179                    "published": {"type": "integer"},
   180                    "protocol": {"type": "string"}
   181                  },
   182                  "additionalProperties": false
   183                }
   184              ]
   185            },
   186            "uniqueItems": true
   187          },
   188  
   189          "privileged": {"type": "boolean"},
   190          "read_only": {"type": "boolean"},
   191          "restart": {"type": "string"},
   192          "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   193          "shm_size": {"type": ["number", "string"]},
   194          "secrets": {
   195            "type": "array",
   196            "items": {
   197              "oneOf": [
   198                {"type": "string"},
   199                {
   200                  "type": "object",
   201                  "properties": {
   202                    "source": {"type": "string"},
   203                    "target": {"type": "string"},
   204                    "uid": {"type": "string"},
   205                    "gid": {"type": "string"},
   206                    "mode": {"type": "number"}
   207                  }
   208                }
   209              ]
   210            }
   211          },
   212          "sysctls": {"$ref": "#/definitions/list_or_dict"},
   213          "stdin_open": {"type": "boolean"},
   214          "stop_grace_period": {"type": "string", "format": "duration"},
   215          "stop_signal": {"type": "string"},
   216          "tmpfs": {"$ref": "#/definitions/string_or_list"},
   217          "tty": {"type": "boolean"},
   218          "ulimits": {
   219            "type": "object",
   220            "patternProperties": {
   221              "^[a-z]+$": {
   222                "oneOf": [
   223                  {"type": "integer"},
   224                  {
   225                    "type":"object",
   226                    "properties": {
   227                      "hard": {"type": "integer"},
   228                      "soft": {"type": "integer"}
   229                    },
   230                    "required": ["soft", "hard"],
   231                    "additionalProperties": false
   232                  }
   233                ]
   234              }
   235            }
   236          },
   237          "user": {"type": "string"},
   238          "userns_mode": {"type": "string"},
   239          "volumes": {
   240            "type": "array",
   241            "items": {
   242              "oneOf": [
   243                {"type": "string"},
   244                {
   245                  "type": "object",
   246                  "required": ["type"],
   247                  "properties": {
   248                    "type": {"type": "string"},
   249                    "source": {"type": "string"},
   250                    "target": {"type": "string"},
   251                    "read_only": {"type": "boolean"},
   252                    "consistency": {"type": "string"},
   253                    "bind": {
   254                      "type": "object",
   255                      "properties": {
   256                        "propagation": {"type": "string"}
   257                      }
   258                    },
   259                    "volume": {
   260                      "type": "object",
   261                      "properties": {
   262                        "nocopy": {"type": "boolean"}
   263                      }
   264                    }
   265                  },
   266                  "additionalProperties": false
   267                }
   268              ],
   269              "uniqueItems": true
   270            }
   271          },
   272          "working_dir": {"type": "string"}
   273        },
   274        "additionalProperties": false
   275      },
   276  
   277      "healthcheck": {
   278        "id": "#/definitions/healthcheck",
   279        "type": "object",
   280        "additionalProperties": false,
   281        "properties": {
   282          "disable": {"type": "boolean"},
   283          "interval": {"type": "string"},
   284          "retries": {"type": "number"},
   285          "test": {
   286            "oneOf": [
   287              {"type": "string"},
   288              {"type": "array", "items": {"type": "string"}}
   289            ]
   290          },
   291          "timeout": {"type": "string"}
   292        }
   293      },
   294      "deployment": {
   295        "id": "#/definitions/deployment",
   296        "type": ["object", "null"],
   297        "properties": {
   298          "mode": {"type": "string"},
   299          "endpoint_mode": {"type": "string"},
   300          "replicas": {"type": "integer"},
   301          "labels": {"$ref": "#/definitions/list_or_dict"},
   302          "update_config": {
   303            "type": "object",
   304            "properties": {
   305              "parallelism": {"type": "integer"},
   306              "delay": {"type": "string", "format": "duration"},
   307              "failure_action": {"type": "string"},
   308              "monitor": {"type": "string", "format": "duration"},
   309              "max_failure_ratio": {"type": "number"}
   310            },
   311            "additionalProperties": false
   312          },
   313          "resources": {
   314            "type": "object",
   315            "properties": {
   316              "limits": {"$ref": "#/definitions/resource"},
   317              "reservations": {"$ref": "#/definitions/resource"}
   318            },
   319            "additionalProperties": false
   320          },
   321          "restart_policy": {
   322            "type": "object",
   323            "properties": {
   324              "condition": {"type": "string"},
   325              "delay": {"type": "string", "format": "duration"},
   326              "max_attempts": {"type": "integer"},
   327              "window": {"type": "string", "format": "duration"}
   328            },
   329            "additionalProperties": false
   330          },
   331          "placement": {
   332            "type": "object",
   333            "properties": {
   334              "constraints": {"type": "array", "items": {"type": "string"}}
   335            },
   336            "additionalProperties": false
   337          }
   338        },
   339        "additionalProperties": false
   340      },
   341  
   342      "resource": {
   343        "id": "#/definitions/resource",
   344        "type": "object",
   345        "properties": {
   346          "cpus": {"type": "string"},
   347          "memory": {"type": "string"}
   348        },
   349        "additionalProperties": false
   350      },
   351  
   352      "network": {
   353        "id": "#/definitions/network",
   354        "type": ["object", "null"],
   355        "properties": {
   356          "driver": {"type": "string"},
   357          "driver_opts": {
   358            "type": "object",
   359            "patternProperties": {
   360              "^.+$": {"type": ["string", "number"]}
   361            }
   362          },
   363          "ipam": {
   364            "type": "object",
   365            "properties": {
   366              "driver": {"type": "string"},
   367              "config": {
   368                "type": "array",
   369                "items": {
   370                  "type": "object",
   371                  "properties": {
   372                    "subnet": {"type": "string"}
   373                  },
   374                  "additionalProperties": false
   375                }
   376              }
   377            },
   378            "additionalProperties": false
   379          },
   380          "external": {
   381            "type": ["boolean", "object"],
   382            "properties": {
   383              "name": {"type": "string"}
   384            },
   385            "additionalProperties": false
   386          },
   387          "internal": {"type": "boolean"},
   388          "attachable": {"type": "boolean"},
   389          "labels": {"$ref": "#/definitions/list_or_dict"}
   390        },
   391        "additionalProperties": false
   392      },
   393  
   394      "volume": {
   395        "id": "#/definitions/volume",
   396        "type": ["object", "null"],
   397        "properties": {
   398          "driver": {"type": "string"},
   399          "driver_opts": {
   400            "type": "object",
   401            "patternProperties": {
   402              "^.+$": {"type": ["string", "number"]}
   403            }
   404          },
   405          "external": {
   406            "type": ["boolean", "object"],
   407            "properties": {
   408              "name": {"type": "string"}
   409            },
   410            "additionalProperties": false
   411          },
   412          "labels": {"$ref": "#/definitions/list_or_dict"}
   413        },
   414        "additionalProperties": false
   415      },
   416  
   417      "secret": {
   418        "id": "#/definitions/secret",
   419        "type": "object",
   420        "properties": {
   421          "file": {"type": "string"},
   422          "external": {
   423            "type": ["boolean", "object"],
   424            "properties": {
   425              "name": {"type": "string"}
   426            }
   427          },
   428          "labels": {"$ref": "#/definitions/list_or_dict"}
   429        },
   430        "additionalProperties": false
   431      },
   432  
   433      "string_or_list": {
   434        "oneOf": [
   435          {"type": "string"},
   436          {"$ref": "#/definitions/list_of_strings"}
   437        ]
   438      },
   439  
   440      "list_of_strings": {
   441        "type": "array",
   442        "items": {"type": "string"},
   443        "uniqueItems": true
   444      },
   445  
   446      "list_or_dict": {
   447        "oneOf": [
   448          {
   449            "type": "object",
   450            "patternProperties": {
   451              ".+": {
   452                "type": ["string", "number", "null"]
   453              }
   454            },
   455            "additionalProperties": false
   456          },
   457          {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
   458        ]
   459      },
   460  
   461      "constraints": {
   462        "service": {
   463          "id": "#/definitions/constraints/service",
   464          "anyOf": [
   465            {"required": ["build"]},
   466            {"required": ["image"]}
   467          ],
   468          "properties": {
   469            "build": {
   470              "required": ["context"]
   471            }
   472          }
   473        }
   474      }
   475    }
   476  }