github.com/khulnasoft/cli@v0.0.0-20240402070845-01bcad7beefa/cli/compose/schema/data/config_schema_v3.12.json (about)

     1  {
     2    "$schema": "http://json-schema.org/draft-04/schema#",
     3    "id": "config_schema_v3.12.json",
     4    "type": "object",
     5  
     6    "properties": {
     7      "version": {
     8        "type": "string",
     9        "default": "3.12"
    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": true
    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          "start_interval": {"type": "string", "format": "duration"}
   351        }
   352      },
   353      "deployment": {
   354        "id": "#/definitions/deployment",
   355        "type": ["object", "null"],
   356        "properties": {
   357          "mode": {"type": "string"},
   358          "endpoint_mode": {"type": "string"},
   359          "replicas": {"type": "integer"},
   360          "labels": {"$ref": "#/definitions/list_or_dict"},
   361          "rollback_config": {
   362            "type": "object",
   363            "properties": {
   364              "parallelism": {"type": "integer"},
   365              "delay": {"type": "string", "format": "duration"},
   366              "failure_action": {"type": "string"},
   367              "monitor": {"type": "string", "format": "duration"},
   368              "max_failure_ratio": {"type": "number"},
   369              "order": {"type": "string", "enum": [
   370                "start-first", "stop-first"
   371              ]}
   372            },
   373            "additionalProperties": false
   374          },
   375          "update_config": {
   376            "type": "object",
   377            "properties": {
   378              "parallelism": {"type": "integer"},
   379              "delay": {"type": "string", "format": "duration"},
   380              "failure_action": {"type": "string"},
   381              "monitor": {"type": "string", "format": "duration"},
   382              "max_failure_ratio": {"type": "number"},
   383              "order": {"type": "string", "enum": [
   384                "start-first", "stop-first"
   385              ]}
   386            },
   387            "additionalProperties": false
   388          },
   389          "resources": {
   390            "type": "object",
   391            "properties": {
   392              "limits": {
   393                "type": "object",
   394                "properties": {
   395                  "cpus": {"type": "string"},
   396                  "memory": {"type": "string"},
   397                  "pids": {"type": "integer"}
   398                },
   399                "additionalProperties": false
   400              },
   401              "reservations": {
   402                "type": "object",
   403                "properties": {
   404                  "cpus": {"type": "string"},
   405                  "memory": {"type": "string"},
   406                  "generic_resources": {"$ref": "#/definitions/generic_resources"}
   407                },
   408                "additionalProperties": false
   409              }
   410            },
   411            "additionalProperties": false
   412          },
   413          "restart_policy": {
   414            "type": "object",
   415            "properties": {
   416              "condition": {"type": "string"},
   417              "delay": {"type": "string", "format": "duration"},
   418              "max_attempts": {"type": "integer"},
   419              "window": {"type": "string", "format": "duration"}
   420            },
   421            "additionalProperties": false
   422          },
   423          "placement": {
   424            "type": "object",
   425            "properties": {
   426              "constraints": {"type": "array", "items": {"type": "string"}},
   427              "preferences": {
   428                "type": "array",
   429                "items": {
   430                  "type": "object",
   431                  "properties": {
   432                    "spread": {"type": "string"}
   433                  },
   434                  "additionalProperties": false
   435                }
   436              },
   437              "max_replicas_per_node": {"type": "integer"}
   438            },
   439            "additionalProperties": false
   440          }
   441        },
   442        "additionalProperties": false
   443      },
   444  
   445      "generic_resources": {
   446        "id": "#/definitions/generic_resources",
   447        "type": "array",
   448        "items": {
   449          "type": "object",
   450          "properties": {
   451            "discrete_resource_spec": {
   452              "type": "object",
   453              "properties": {
   454                "kind": {"type": "string"},
   455                "value": {"type": "number"}
   456              },
   457              "additionalProperties": false
   458            }
   459          },
   460          "additionalProperties": false
   461        }
   462      },
   463  
   464      "network": {
   465        "id": "#/definitions/network",
   466        "type": ["object", "null"],
   467        "properties": {
   468          "name": {"type": "string"},
   469          "driver": {"type": "string"},
   470          "driver_opts": {
   471            "type": "object",
   472            "patternProperties": {
   473              "^.+$": {"type": ["string", "number"]}
   474            }
   475          },
   476          "ipam": {
   477            "type": "object",
   478            "properties": {
   479              "driver": {"type": "string"},
   480              "config": {
   481                "type": "array",
   482                "items": {
   483                  "type": "object",
   484                  "properties": {
   485                    "subnet": {"type": "string"}
   486                  },
   487                  "additionalProperties": false
   488                }
   489              }
   490            },
   491            "additionalProperties": false
   492          },
   493          "external": {
   494            "type": ["boolean", "object"],
   495            "properties": {
   496              "name": {"type": "string"}
   497            },
   498            "additionalProperties": false
   499          },
   500          "internal": {"type": "boolean"},
   501          "attachable": {"type": "boolean"},
   502          "labels": {"$ref": "#/definitions/list_or_dict"}
   503        },
   504        "patternProperties": {"^x-": {}},
   505        "additionalProperties": false
   506      },
   507  
   508      "volume": {
   509        "id": "#/definitions/volume",
   510        "type": ["object", "null"],
   511        "properties": {
   512          "name": {"type": "string"},
   513          "driver": {"type": "string"},
   514          "driver_opts": {
   515            "type": "object",
   516            "patternProperties": {
   517              "^.+$": {"type": ["string", "number"]}
   518            }
   519          },
   520          "external": {
   521            "type": ["boolean", "object"],
   522            "properties": {
   523              "name": {"type": "string"}
   524            },
   525            "additionalProperties": false
   526          },
   527          "labels": {"$ref": "#/definitions/list_or_dict"},
   528          "x-cluster-spec": {
   529            "type": "object",
   530            "properties": {
   531              "group": {"type": "string"},
   532              "access_mode": {
   533                "type": "object",
   534                "properties": {
   535                  "scope": {"type": "string"},
   536                  "sharing": {"type": "string"},
   537                  "block_volume": {"type": "object"},
   538                  "mount_volume": {
   539                    "type": "object",
   540                    "properties": {
   541                      "fs_type": {"type": "string"},
   542                      "mount_flags": {"type": "array", "items": {"type": "string"}}
   543                    }
   544                  }
   545                }
   546              },
   547              "accessibility_requirements": {
   548                "type": "object",
   549                "properties": {
   550                  "requisite": {
   551                    "type": "array",
   552                    "items": {
   553                      "type": "object",
   554                      "properties": {
   555                        "segments": {"$ref": "#/definitions/list_or_dict"}
   556                      }
   557                    }
   558                  },
   559                  "preferred": {
   560                    "type": "array",
   561                    "items": {
   562                      "type": "object",
   563                      "properties": {
   564                        "segments": {"$ref": "#/definitions/list_or_dict"}
   565                      }
   566                    }
   567                  }
   568                }
   569              },
   570              "capacity_range": {
   571                "type": "object",
   572                "properties": {
   573                  "required_bytes": {"type": "string"},
   574                  "limit_bytes": {"type": "string"}
   575                }
   576              },
   577              "availability": {"type": "string"}
   578            }
   579          }
   580        },
   581        "patternProperties": {"^x-": {}},
   582        "additionalProperties": false
   583      },
   584  
   585      "secret": {
   586        "id": "#/definitions/secret",
   587        "type": "object",
   588        "properties": {
   589          "name": {"type": "string"},
   590          "file": {"type": "string"},
   591          "external": {
   592            "type": ["boolean", "object"],
   593            "properties": {
   594              "name": {"type": "string"}
   595            }
   596          },
   597          "labels": {"$ref": "#/definitions/list_or_dict"},
   598          "driver": {"type": "string"},
   599          "driver_opts": {
   600            "type": "object",
   601            "patternProperties": {
   602              "^.+$": {"type": ["string", "number"]}
   603            }
   604          },
   605          "template_driver": {"type": "string"}
   606        },
   607        "patternProperties": {"^x-": {}},
   608        "additionalProperties": false
   609      },
   610  
   611      "config": {
   612        "id": "#/definitions/config",
   613        "type": "object",
   614        "properties": {
   615          "name": {"type": "string"},
   616          "file": {"type": "string"},
   617          "external": {
   618            "type": ["boolean", "object"],
   619            "properties": {
   620              "name": {"type": "string"}
   621            }
   622          },
   623          "labels": {"$ref": "#/definitions/list_or_dict"},
   624          "template_driver": {"type": "string"}
   625        },
   626        "patternProperties": {"^x-": {}},
   627        "additionalProperties": false
   628      },
   629  
   630      "string_or_list": {
   631        "oneOf": [
   632          {"type": "string"},
   633          {"$ref": "#/definitions/list_of_strings"}
   634        ]
   635      },
   636  
   637      "list_of_strings": {
   638        "type": "array",
   639        "items": {"type": "string"},
   640        "uniqueItems": true
   641      },
   642  
   643      "list_or_dict": {
   644        "oneOf": [
   645          {
   646            "type": "object",
   647            "patternProperties": {
   648              ".+": {
   649                "type": ["string", "number", "null"]
   650              }
   651            },
   652            "additionalProperties": false
   653          },
   654          {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
   655        ]
   656      },
   657  
   658      "constraints": {
   659        "service": {
   660          "id": "#/definitions/constraints/service",
   661          "anyOf": [
   662            {"required": ["build"]},
   663            {"required": ["image"]}
   664          ],
   665          "properties": {
   666            "build": {
   667              "required": ["context"]
   668            }
   669          }
   670        }
   671      }
   672    }
   673  }