github.com/khulnasoft/cli@v0.0.0-20240402070845-01bcad7beefa/cli/compose/loader/testdata/full-example.json.golden (about) 1 { 2 "configs": { 3 "config1": { 4 "file": "/foo/config_data", 5 "external": false, 6 "labels": { 7 "foo": "bar" 8 } 9 }, 10 "config2": { 11 "name": "my_config", 12 "external": true 13 }, 14 "config3": { 15 "name": "config3", 16 "external": true 17 }, 18 "config4": { 19 "name": "foo", 20 "file": "/foo", 21 "external": false 22 } 23 }, 24 "networks": { 25 "external-network": { 26 "name": "external-network", 27 "ipam": {}, 28 "external": true 29 }, 30 "other-external-network": { 31 "name": "my-cool-network", 32 "ipam": {}, 33 "external": true 34 }, 35 "other-network": { 36 "driver": "overlay", 37 "driver_opts": { 38 "baz": "1", 39 "foo": "bar" 40 }, 41 "ipam": { 42 "driver": "overlay", 43 "config": [ 44 { 45 "subnet": "172.16.238.0/24" 46 }, 47 { 48 "subnet": "2001:3984:3989::/64" 49 } 50 ] 51 }, 52 "external": false, 53 "labels": { 54 "foo": "bar" 55 } 56 }, 57 "some-network": { 58 "ipam": {}, 59 "external": false 60 } 61 }, 62 "secrets": { 63 "secret1": { 64 "file": "/foo/secret_data", 65 "external": false, 66 "labels": { 67 "foo": "bar" 68 } 69 }, 70 "secret2": { 71 "name": "my_secret", 72 "external": true 73 }, 74 "secret3": { 75 "name": "secret3", 76 "external": true 77 }, 78 "secret4": { 79 "name": "bar", 80 "file": "/foo", 81 "external": false 82 } 83 }, 84 "services": { 85 "foo": { 86 "build": { 87 "context": "./dir", 88 "dockerfile": "Dockerfile", 89 "args": { 90 "foo": "bar" 91 }, 92 "labels": { 93 "FOO": "BAR" 94 }, 95 "cache_from": [ 96 "foo", 97 "bar" 98 ], 99 "extra_hosts": [ 100 "ipv4.example.com:127.0.0.1", 101 "ipv6.example.com:::1" 102 ], 103 "network": "foo", 104 "target": "foo" 105 }, 106 "cap_add": [ 107 "ALL" 108 ], 109 "cap_drop": [ 110 "NET_ADMIN", 111 "SYS_ADMIN" 112 ], 113 "cgroup_parent": "m-executor-abcd", 114 "command": [ 115 "bundle", 116 "exec", 117 "thin", 118 "-p", 119 "3000" 120 ], 121 "configs": [ 122 { 123 "source": "config1" 124 }, 125 { 126 "source": "config2", 127 "target": "/my_config", 128 "uid": "103", 129 "gid": "103", 130 "mode": 288 131 } 132 ], 133 "container_name": "my-web-container", 134 "credential_spec": {}, 135 "depends_on": [ 136 "db", 137 "redis" 138 ], 139 "deploy": { 140 "mode": "replicated", 141 "replicas": 6, 142 "labels": { 143 "FOO": "BAR" 144 }, 145 "update_config": { 146 "parallelism": 3, 147 "delay": "10s", 148 "failure_action": "continue", 149 "monitor": "1m0s", 150 "max_failure_ratio": 0.3, 151 "order": "start-first" 152 }, 153 "rollback_config": { 154 "parallelism": 3, 155 "delay": "10s", 156 "failure_action": "continue", 157 "monitor": "1m0s", 158 "max_failure_ratio": 0.3, 159 "order": "start-first" 160 }, 161 "resources": { 162 "limits": { 163 "cpus": "0.001", 164 "memory": "52428800", 165 "pids": 100 166 }, 167 "reservations": { 168 "cpus": "0.0001", 169 "memory": "20971520", 170 "generic_resources": [ 171 { 172 "discrete_resource_spec": { 173 "kind": "gpu", 174 "value": 2 175 } 176 }, 177 { 178 "discrete_resource_spec": { 179 "kind": "ssd", 180 "value": 1 181 } 182 } 183 ] 184 } 185 }, 186 "restart_policy": { 187 "condition": "on-failure", 188 "delay": "5s", 189 "max_attempts": 3, 190 "window": "2m0s" 191 }, 192 "placement": { 193 "constraints": [ 194 "node=foo" 195 ], 196 "preferences": [ 197 { 198 "spread": "node.labels.az" 199 } 200 ], 201 "max_replicas_per_node": 5 202 }, 203 "endpoint_mode": "dnsrr" 204 }, 205 "devices": [ 206 "/dev/ttyUSB0:/dev/ttyUSB0" 207 ], 208 "dns": [ 209 "8.8.8.8", 210 "9.9.9.9" 211 ], 212 "dns_search": [ 213 "dc1.example.com", 214 "dc2.example.com" 215 ], 216 "domainname": "foo.com", 217 "entrypoint": [ 218 "/code/entrypoint.sh", 219 "-p", 220 "3000" 221 ], 222 "environment": { 223 "BAR": "bar_from_env_file_2", 224 "BAZ": "baz_from_service_def", 225 "FOO": "foo_from_env_file", 226 "QUX": "qux_from_environment" 227 }, 228 "env_file": [ 229 "./example1.env", 230 "./example2.env" 231 ], 232 "expose": [ 233 "3000", 234 "8000" 235 ], 236 "external_links": [ 237 "redis_1", 238 "project_db_1:mysql", 239 "project_db_1:postgresql" 240 ], 241 "extra_hosts": [ 242 "somehost:162.242.195.82", 243 "otherhost:50.31.209.229", 244 "host.docker.internal:host-gateway" 245 ], 246 "hostname": "foo", 247 "healthcheck": { 248 "test": [ 249 "CMD-SHELL", 250 "echo \"hello world\"" 251 ], 252 "timeout": "1s", 253 "interval": "10s", 254 "retries": 5, 255 "start_period": "15s", 256 "start_interval": "1s" 257 }, 258 "image": "redis", 259 "ipc": "host", 260 "labels": { 261 "com.example.description": "Accounting webapp", 262 "com.example.empty-label": "", 263 "com.example.number": "42" 264 }, 265 "links": [ 266 "db", 267 "db:database", 268 "redis" 269 ], 270 "logging": { 271 "driver": "syslog", 272 "options": { 273 "syslog-address": "tcp://192.168.0.42:123" 274 } 275 }, 276 "mac_address": "02:42:ac:11:65:43", 277 "network_mode": "container:0cfeab0f748b9a743dc3da582046357c6ef497631c1a016d28d2bf9b4f899f7b", 278 "networks": { 279 "other-network": { 280 "ipv4_address": "172.16.238.10", 281 "ipv6_address": "2001:3984:3989::10" 282 }, 283 "other-other-network": null, 284 "some-network": { 285 "aliases": [ 286 "alias1", 287 "alias3" 288 ] 289 } 290 }, 291 "pid": "host", 292 "ports": [ 293 { 294 "mode": "ingress", 295 "target": 3000, 296 "protocol": "tcp" 297 }, 298 { 299 "mode": "ingress", 300 "target": 3001, 301 "protocol": "tcp" 302 }, 303 { 304 "mode": "ingress", 305 "target": 3002, 306 "protocol": "tcp" 307 }, 308 { 309 "mode": "ingress", 310 "target": 3003, 311 "protocol": "tcp" 312 }, 313 { 314 "mode": "ingress", 315 "target": 3004, 316 "protocol": "tcp" 317 }, 318 { 319 "mode": "ingress", 320 "target": 3005, 321 "protocol": "tcp" 322 }, 323 { 324 "mode": "ingress", 325 "target": 8000, 326 "published": 8000, 327 "protocol": "tcp" 328 }, 329 { 330 "mode": "ingress", 331 "target": 8080, 332 "published": 9090, 333 "protocol": "tcp" 334 }, 335 { 336 "mode": "ingress", 337 "target": 8081, 338 "published": 9091, 339 "protocol": "tcp" 340 }, 341 { 342 "mode": "ingress", 343 "target": 22, 344 "published": 49100, 345 "protocol": "tcp" 346 }, 347 { 348 "mode": "ingress", 349 "target": 8001, 350 "published": 8001, 351 "protocol": "tcp" 352 }, 353 { 354 "mode": "ingress", 355 "target": 5000, 356 "published": 5000, 357 "protocol": "tcp" 358 }, 359 { 360 "mode": "ingress", 361 "target": 5001, 362 "published": 5001, 363 "protocol": "tcp" 364 }, 365 { 366 "mode": "ingress", 367 "target": 5002, 368 "published": 5002, 369 "protocol": "tcp" 370 }, 371 { 372 "mode": "ingress", 373 "target": 5003, 374 "published": 5003, 375 "protocol": "tcp" 376 }, 377 { 378 "mode": "ingress", 379 "target": 5004, 380 "published": 5004, 381 "protocol": "tcp" 382 }, 383 { 384 "mode": "ingress", 385 "target": 5005, 386 "published": 5005, 387 "protocol": "tcp" 388 }, 389 { 390 "mode": "ingress", 391 "target": 5006, 392 "published": 5006, 393 "protocol": "tcp" 394 }, 395 { 396 "mode": "ingress", 397 "target": 5007, 398 "published": 5007, 399 "protocol": "tcp" 400 }, 401 { 402 "mode": "ingress", 403 "target": 5008, 404 "published": 5008, 405 "protocol": "tcp" 406 }, 407 { 408 "mode": "ingress", 409 "target": 5009, 410 "published": 5009, 411 "protocol": "tcp" 412 }, 413 { 414 "mode": "ingress", 415 "target": 5010, 416 "published": 5010, 417 "protocol": "tcp" 418 } 419 ], 420 "privileged": true, 421 "read_only": true, 422 "restart": "always", 423 "secrets": [ 424 { 425 "source": "secret1" 426 }, 427 { 428 "source": "secret2", 429 "target": "my_secret", 430 "uid": "103", 431 "gid": "103", 432 "mode": 288 433 } 434 ], 435 "security_opt": [ 436 "label=level:s0:c100,c200", 437 "label=type:svirt_apache_t" 438 ], 439 "stdin_open": true, 440 "stop_grace_period": "20s", 441 "stop_signal": "SIGUSR1", 442 "sysctls": { 443 "net.core.somaxconn": "1024", 444 "net.ipv4.tcp_syncookies": "0" 445 }, 446 "tmpfs": [ 447 "/run", 448 "/tmp" 449 ], 450 "tty": true, 451 "ulimits": { 452 "nofile": { 453 "soft": 20000, 454 "hard": 40000 455 }, 456 "nproc": 65535 457 }, 458 "user": "someone", 459 "volumes": [ 460 { 461 "type": "volume", 462 "target": "/var/lib/mysql" 463 }, 464 { 465 "type": "bind", 466 "source": "/opt/data", 467 "target": "/var/lib/mysql" 468 }, 469 { 470 "type": "bind", 471 "source": "/foo", 472 "target": "/code" 473 }, 474 { 475 "type": "bind", 476 "source": "/foo/static", 477 "target": "/var/www/html" 478 }, 479 { 480 "type": "bind", 481 "source": "/bar/configs", 482 "target": "/etc/configs/", 483 "read_only": true 484 }, 485 { 486 "type": "volume", 487 "source": "datavolume", 488 "target": "/var/lib/mysql" 489 }, 490 { 491 "type": "bind", 492 "source": "/foo/opt", 493 "target": "/opt", 494 "consistency": "cached" 495 }, 496 { 497 "type": "tmpfs", 498 "target": "/opt", 499 "tmpfs": { 500 "size": 10000 501 } 502 }, 503 { 504 "type": "cluster", 505 "source": "group:mygroup", 506 "target": "/srv" 507 } 508 ], 509 "working_dir": "/code" 510 } 511 }, 512 "version": "3.12", 513 "volumes": { 514 "another-volume": { 515 "name": "user_specified_name", 516 "driver": "vsphere", 517 "driver_opts": { 518 "baz": "1", 519 "foo": "bar" 520 }, 521 "external": false 522 }, 523 "cluster-volume": { 524 "driver": "my-csi-driver", 525 "external": false, 526 "x-cluster-spec": { 527 "group": "mygroup", 528 "access_mode": { 529 "scope": "single", 530 "sharing": "none", 531 "block_volume": {} 532 }, 533 "accessibility_requirements": { 534 "requisite": [ 535 { 536 "segments": { 537 "region": "R1", 538 "zone": "Z1" 539 } 540 }, 541 { 542 "segments": { 543 "region": "R1", 544 "zone": "Z2" 545 } 546 } 547 ], 548 "preferred": [ 549 { 550 "segments": { 551 "region": "R1", 552 "zone": "Z1" 553 } 554 } 555 ] 556 }, 557 "capacity_range": { 558 "required_bytes": "1073741824", 559 "limit_bytes": "8589934592" 560 }, 561 "secrets": [ 562 { 563 "key": "mycsisecret", 564 "secret": "secret1" 565 }, 566 { 567 "key": "mycsisecret2", 568 "secret": "secret4" 569 } 570 ], 571 "availability": "active" 572 } 573 }, 574 "external-volume": { 575 "name": "external-volume", 576 "external": true 577 }, 578 "external-volume3": { 579 "name": "this-is-volume3", 580 "external": true 581 }, 582 "other-external-volume": { 583 "name": "my-cool-volume", 584 "external": true 585 }, 586 "other-volume": { 587 "driver": "flocker", 588 "driver_opts": { 589 "baz": "1", 590 "foo": "bar" 591 }, 592 "external": false, 593 "labels": { 594 "foo": "bar" 595 } 596 }, 597 "some-volume": { 598 "external": false 599 } 600 }, 601 "x-bar": "baz", 602 "x-foo": "bar", 603 "x-nested": { 604 "bar": "baz", 605 "foo": "bar" 606 } 607 }