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