github.com/khulnasoft/cli@v0.0.0-20240402070845-01bcad7beefa/cli/compose/schema/data/config_schema_v3.10.json (about) 1 { 2 "$schema": "http://json-schema.org/draft-04/schema#", 3 "id": "config_schema_v3.10.json", 4 "type": "object", 5 6 "properties": { 7 "version": { 8 "type": "string", 9 "default": "3.10" 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 "x-cluster-spec": { 528 "type": "object", 529 "properties": { 530 "group": {"type": "string"}, 531 "access_mode": { 532 "type": "object", 533 "properties": { 534 "scope": {"type": "string"}, 535 "sharing": {"type": "string"}, 536 "block_volume": {"type": "object"}, 537 "mount_volume": { 538 "type": "object", 539 "properties": { 540 "fs_type": {"type": "string"}, 541 "mount_flags": {"type": "array", "items": {"type": "string"}} 542 } 543 } 544 } 545 }, 546 "accessibility_requirements": { 547 "type": "object", 548 "properties": { 549 "requisite": { 550 "type": "array", 551 "items": { 552 "type": "object", 553 "properties": { 554 "segments": {"$ref": "#/definitions/list_or_dict"} 555 } 556 } 557 }, 558 "preferred": { 559 "type": "array", 560 "items": { 561 "type": "object", 562 "properties": { 563 "segments": {"$ref": "#/definitions/list_or_dict"} 564 } 565 } 566 } 567 } 568 }, 569 "capacity_range": { 570 "type": "object", 571 "properties": { 572 "required_bytes": {"type": "string"}, 573 "limit_bytes": {"type": "string"} 574 } 575 }, 576 "availability": {"type": "string"} 577 } 578 } 579 }, 580 "patternProperties": {"^x-": {}}, 581 "additionalProperties": false 582 }, 583 584 "secret": { 585 "id": "#/definitions/secret", 586 "type": "object", 587 "properties": { 588 "name": {"type": "string"}, 589 "file": {"type": "string"}, 590 "external": { 591 "type": ["boolean", "object"], 592 "properties": { 593 "name": {"type": "string"} 594 } 595 }, 596 "labels": {"$ref": "#/definitions/list_or_dict"}, 597 "driver": {"type": "string"}, 598 "driver_opts": { 599 "type": "object", 600 "patternProperties": { 601 "^.+$": {"type": ["string", "number"]} 602 } 603 }, 604 "template_driver": {"type": "string"} 605 }, 606 "patternProperties": {"^x-": {}}, 607 "additionalProperties": false 608 }, 609 610 "config": { 611 "id": "#/definitions/config", 612 "type": "object", 613 "properties": { 614 "name": {"type": "string"}, 615 "file": {"type": "string"}, 616 "external": { 617 "type": ["boolean", "object"], 618 "properties": { 619 "name": {"type": "string"} 620 } 621 }, 622 "labels": {"$ref": "#/definitions/list_or_dict"}, 623 "template_driver": {"type": "string"} 624 }, 625 "patternProperties": {"^x-": {}}, 626 "additionalProperties": false 627 }, 628 629 "string_or_list": { 630 "oneOf": [ 631 {"type": "string"}, 632 {"$ref": "#/definitions/list_of_strings"} 633 ] 634 }, 635 636 "list_of_strings": { 637 "type": "array", 638 "items": {"type": "string"}, 639 "uniqueItems": true 640 }, 641 642 "list_or_dict": { 643 "oneOf": [ 644 { 645 "type": "object", 646 "patternProperties": { 647 ".+": { 648 "type": ["string", "number", "null"] 649 } 650 }, 651 "additionalProperties": false 652 }, 653 {"type": "array", "items": {"type": "string"}, "uniqueItems": true} 654 ] 655 }, 656 657 "constraints": { 658 "service": { 659 "id": "#/definitions/constraints/service", 660 "anyOf": [ 661 {"required": ["build"]}, 662 {"required": ["image"]} 663 ], 664 "properties": { 665 "build": { 666 "required": ["context"] 667 } 668 } 669 } 670 } 671 } 672 }