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