forked from compose-spec/compose-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose-spec.json
More file actions
1895 lines (1863 loc) · 72.4 KB
/
compose-spec.json
File metadata and controls
1895 lines (1863 loc) · 72.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"$schema": "https://json-schema.org/draft-07/schema",
"$id": "compose_spec.json",
"type": "object",
"title": "Compose Specification",
"description": "The Compose file is a YAML file defining a multi-containers based application.",
"properties": {
"version": {
"type": "string",
"deprecated": true,
"description": "declared for backward compatibility, ignored. Please remove it."
},
"name": {
"type": "string",
"description": "define the Compose project name, until user defines one explicitly."
},
"include": {
"type": "array",
"items": {
"$ref": "#/definitions/include"
},
"description": "compose sub-projects to be included."
},
"services": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9._-]+$": {
"$ref": "#/definitions/service"
}
},
"additionalProperties": false,
"description": "The services that will be used by your application."
},
"models": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9._-]+$": {
"$ref": "#/definitions/model"
}
},
"description": "Language models that will be used by your application."
},
"networks": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9._-]+$": {
"$ref": "#/definitions/network"
}
},
"description": "Networks that are shared among multiple services."
},
"volumes": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9._-]+$": {
"$ref": "#/definitions/volume"
}
},
"additionalProperties": false,
"description": "Named volumes that are shared among multiple services."
},
"secrets": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9._-]+$": {
"$ref": "#/definitions/secret"
}
},
"additionalProperties": false,
"description": "Secrets that are shared among multiple services."
},
"configs": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9._-]+$": {
"$ref": "#/definitions/config"
}
},
"additionalProperties": false,
"description": "Configurations that are shared among multiple services."
}
},
"patternProperties": {"^x-": {}},
"additionalProperties": false,
"definitions": {
"service": {
"type": "object",
"description": "Configuration for a service.",
"properties": {
"develop": {"$ref": "#/definitions/development"},
"deploy": {"$ref": "#/definitions/deployment"},
"annotations": {"$ref": "#/definitions/list_or_dict"},
"attach": {"type": ["boolean", "string"]},
"build": {
"description": "Configuration options for building the service's image.",
"oneOf": [
{"type": "string", "description": "Path to the build context. Can be a relative path or a URL."},
{
"type": "object",
"properties": {
"context": {"type": "string", "description": "Path to the build context. Can be a relative path or a URL."},
"dockerfile": {"type": "string", "description": "Name of the Dockerfile to use for building the image."},
"dockerfile_inline": {"type": "string", "description": "Inline Dockerfile content to use instead of a Dockerfile from the build context."},
"entitlements": {"type": "array", "items": {"type": "string"}, "description": "List of extra privileged entitlements to grant to the build process."},
"args": {"$ref": "#/definitions/list_or_dict", "description": "Build-time variables, specified as a map or a list of KEY=VAL pairs."},
"ssh": {"$ref": "#/definitions/list_or_dict", "description": "SSH agent socket or keys to expose to the build. Format is either a string or a list of 'default|<id>[=<socket>|<key>[,<key>]]'."},
"labels": {"$ref": "#/definitions/list_or_dict", "description": "Labels to apply to the built image."},
"cache_from": {"type": "array", "items": {"type": "string"}, "description": "List of sources the image builder should use for cache resolution"},
"cache_to": {"type": "array", "items": {"type": "string"}, "description": "Cache destinations for the build cache."},
"no_cache": {"type": ["boolean", "string"], "description": "Do not use cache when building the image."},
"additional_contexts": {"$ref": "#/definitions/list_or_dict", "description": "Additional build contexts to use, specified as a map of name to context path or URL."},
"network": {"type": "string", "description": "Network mode to use for the build. Options include 'default', 'none', 'host', or a network name."},
"pull": {"type": ["boolean", "string"], "description": "Always attempt to pull a newer version of the image."},
"target": {"type": "string", "description": "Build stage to target in a multi-stage Dockerfile."},
"shm_size": {"type": ["integer", "string"], "description": "Size of /dev/shm for the build container. A string value can use suffix like '2g' for 2 gigabytes."},
"extra_hosts": {"$ref": "#/definitions/extra_hosts", "description": "Add hostname mappings for the build container."},
"isolation": {"type": "string", "description": "Container isolation technology to use for the build process."},
"privileged": {"type": ["boolean", "string"], "description": "Give extended privileges to the build container."},
"secrets": {"$ref": "#/definitions/service_config_or_secret", "description": "Secrets to expose to the build. These are accessible at build-time."},
"tags": {"type": "array", "items": {"type": "string"}, "description": "Additional tags to apply to the built image."},
"ulimits": {"$ref": "#/definitions/ulimits", "description": "Override the default ulimits for the build container."},
"platforms": {"type": "array", "items": {"type": "string"}, "description": "Platforms to build for, e.g., 'linux/amd64', 'linux/arm64', or 'windows/amd64'."}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
}
]
},
"blkio_config": {
"type": "object",
"description": "Block IO configuration for the service.",
"properties": {
"device_read_bps": {
"type": "array",
"description": "Limit read rate (bytes per second) from a device.",
"items": {"$ref": "#/definitions/blkio_limit"}
},
"device_read_iops": {
"type": "array",
"description": "Limit read rate (IO per second) from a device.",
"items": {"$ref": "#/definitions/blkio_limit"}
},
"device_write_bps": {
"type": "array",
"description": "Limit write rate (bytes per second) to a device.",
"items": {"$ref": "#/definitions/blkio_limit"}
},
"device_write_iops": {
"type": "array",
"description": "Limit write rate (IO per second) to a device.",
"items": {"$ref": "#/definitions/blkio_limit"}
},
"weight": {
"type": ["integer", "string"],
"description": "Block IO weight (relative weight) for the service, between 10 and 1000."
},
"weight_device": {
"type": "array",
"description": "Block IO weight (relative weight) for specific devices.",
"items": {"$ref": "#/definitions/blkio_weight"}
}
},
"additionalProperties": false
},
"cap_add": {
"type": "array",
"items": {"type": "string"},
"uniqueItems": true,
"description": "Add Linux capabilities. For example, 'CAP_SYS_ADMIN', 'SYS_ADMIN', or 'NET_ADMIN'."
},
"cap_drop": {
"type": "array",
"items": {"type": "string"},
"uniqueItems": true,
"description": "Drop Linux capabilities. For example, 'CAP_SYS_ADMIN', 'SYS_ADMIN', or 'NET_ADMIN'."
},
"cgroup": {
"type": "string",
"enum": ["host", "private"],
"description": "Specify the cgroup namespace to join. Use 'host' to use the host's cgroup namespace, or 'private' to use a private cgroup namespace."
},
"cgroup_parent": {
"type": "string",
"description": "Specify an optional parent cgroup for the container."
},
"command": {
"$ref": "#/definitions/command",
"description": "Override the default command declared by the container image, for example 'CMD' in Dockerfile."
},
"configs": {
"$ref": "#/definitions/service_config_or_secret",
"description": "Grant access to Configs on a per-service basis."
},
"container_name": {
"type": "string",
"description": "Specify a custom container name, rather than a generated default name."
},
"cpu_count": {
"oneOf": [
{"type": "string"},
{"type": "integer", "minimum": 0}
],
"description": "Number of usable CPUs."
},
"cpu_percent": {
"oneOf": [
{"type": "string"},
{"type": "integer", "minimum": 0, "maximum": 100}
],
"description": "Percentage of CPU resources to use."
},
"cpu_shares": {
"type": ["number", "string"],
"description": "CPU shares (relative weight) for the container."
},
"cpu_quota": {
"type": ["number", "string"],
"description": "Limit the CPU CFS (Completely Fair Scheduler) quota."
},
"cpu_period": {
"type": ["number", "string"],
"description": "Limit the CPU CFS (Completely Fair Scheduler) period."
},
"cpu_rt_period": {
"type": ["number", "string"],
"description": "Limit the CPU real-time period in microseconds or a duration."
},
"cpu_rt_runtime": {
"type": ["number", "string"],
"description": "Limit the CPU real-time runtime in microseconds or a duration."
},
"cpus": {
"type": ["number", "string"],
"description": "Number of CPUs to use. A floating-point value is supported to request partial CPUs."
},
"cpuset": {
"type": "string",
"description": "CPUs in which to allow execution (0-3, 0,1)."
},
"credential_spec": {
"type": "object",
"description": "Configure the credential spec for managed service account.",
"properties": {
"config": {
"type": "string",
"description": "The name of the credential spec Config to use."
},
"file": {
"type": "string",
"description": "Path to a credential spec file."
},
"registry": {
"type": "string",
"description": "Path to a credential spec in the Windows registry."
}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
},
"depends_on": {
"oneOf": [
{"$ref": "#/definitions/list_of_strings"},
{
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^[a-zA-Z0-9._-]+$": {
"type": "object",
"additionalProperties": false,
"patternProperties": {"^x-": {}},
"properties": {
"restart": {
"type": ["boolean", "string"],
"description": "Whether to restart dependent services when this service is restarted."
},
"required": {
"type": "boolean",
"default": true,
"description": "Whether the dependency is required for the dependent service to start."
},
"condition": {
"type": "string",
"enum": ["service_started", "service_healthy", "service_completed_successfully"],
"description": "Condition to wait for. 'service_started' waits until the service has started, 'service_healthy' waits until the service is healthy (as defined by its healthcheck), 'service_completed_successfully' waits until the service has completed successfully."
}
},
"required": ["condition"]
}
}
}
],
"description": "Express dependency between services. Service dependencies cause services to be started in dependency order. The dependent service will wait for the dependency to be ready before starting."
},
"device_cgroup_rules": {
"$ref": "#/definitions/list_of_strings",
"description": "Add rules to the cgroup allowed devices list."
},
"devices": {
"type": "array",
"description": "List of device mappings for the container.",
"items": {
"oneOf": [
{"type": "string"},
{
"type": "object",
"required": ["source"],
"properties": {
"source": {
"type": "string",
"description": "Path on the host to the device."
},
"target": {
"type": "string",
"description": "Path in the container where the device will be mapped."
},
"permissions": {
"type": "string",
"description": "Cgroup permissions for the device (rwm)."
}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
}
]
}
},
"dns": {
"$ref": "#/definitions/string_or_list",
"description": "Custom DNS servers to set for the service container."
},
"dns_opt": {
"type": "array",
"items": {"type": "string"},
"uniqueItems": true,
"description": "Custom DNS options to be passed to the container's DNS resolver."
},
"dns_search": {
"$ref": "#/definitions/string_or_list",
"description": "Custom DNS search domains to set on the service container."
},
"domainname": {
"type": "string",
"description": "Custom domain name to use for the service container."
},
"entrypoint": {
"$ref": "#/definitions/command",
"description": "Override the default entrypoint declared by the container image, for example 'ENTRYPOINT' in Dockerfile."
},
"env_file": {
"$ref": "#/definitions/env_file",
"description": "Add environment variables from a file or multiple files. Can be a single file path or a list of file paths."
},
"label_file": {
"$ref": "#/definitions/label_file",
"description": "Add metadata to containers using files containing Docker labels."
},
"environment": {
"$ref": "#/definitions/list_or_dict",
"description": "Add environment variables. You can use either an array or a list of KEY=VAL pairs."
},
"expose": {
"type": "array",
"items": {
"type": ["string", "number"]
},
"uniqueItems": true,
"description": "Expose ports without publishing them to the host machine - they'll only be accessible to linked services."
},
"extends": {
"oneOf": [
{"type": "string"},
{
"type": "object",
"properties": {
"service": {
"type": "string",
"description": "The name of the service to extend."
},
"file": {
"type": "string",
"description": "The file path where the service to extend is defined."
}
},
"required": ["service"],
"additionalProperties": false
}
],
"description": "Extend another service, in the current file or another file."
},
"provider": {
"type": "object",
"description": "Specify a service which will not be manage by Compose directly, and delegate its management to an external provider.",
"required": ["type"],
"properties": {
"type": {
"type": "string",
"description": "External component used by Compose to manage setup and teardown lifecycle of the service."
},
"options": {
"type": "object",
"description": "Provider-specific options.",
"patternProperties": {
"^.+$": {"oneOf": [
{ "type": ["string", "number", "boolean"] },
{ "type": "array", "items": {"type": ["string", "number", "boolean"]}}
]}
}
}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
},
"external_links": {
"type": "array",
"items": {"type": "string"},
"uniqueItems": true,
"description": "Link to services started outside this Compose application. Specify services as <service_name>:<alias>."
},
"extra_hosts": {
"$ref": "#/definitions/extra_hosts",
"description": "Add hostname mappings to the container network interface configuration."
},
"gpus": {
"$ref": "#/definitions/gpus",
"description": "Define GPU devices to use. Can be set to 'all' to use all GPUs, or a list of specific GPU devices."
},
"group_add": {
"type": "array",
"items": {
"type": ["string", "number"]
},
"uniqueItems": true,
"description": "Add additional groups which user inside the container should be member of."
},
"healthcheck": {
"$ref": "#/definitions/healthcheck",
"description": "Configure a health check for the container to monitor its health status."
},
"hostname": {
"type": "string",
"description": "Define a custom hostname for the service container."
},
"image": {
"type": "string",
"description": "Specify the image to start the container from. Can be a repository/tag, a digest, or a local image ID."
},
"init": {
"type": ["boolean", "string"],
"description": "Run as an init process inside the container that forwards signals and reaps processes."
},
"ipc": {
"type": "string",
"description": "IPC sharing mode for the service container. Use 'host' to share the host's IPC namespace, 'service:[service_name]' to share with another service, or 'shareable' to allow other services to share this service's IPC namespace."
},
"isolation": {
"type": "string",
"description": "Container isolation technology to use. Supported values are platform-specific."
},
"labels": {
"$ref": "#/definitions/list_or_dict",
"description": "Add metadata to containers using Docker labels. You can use either an array or a list."
},
"links": {
"type": "array",
"items": {"type": "string"},
"uniqueItems": true,
"description": "Link to containers in another service. Either specify both the service name and a link alias (SERVICE:ALIAS), or just the service name."
},
"logging": {
"type": "object",
"description": "Logging configuration for the service.",
"properties": {
"driver": {
"type": "string",
"description": "Logging driver to use, such as 'json-file', 'syslog', 'journald', etc."
},
"options": {
"type": "object",
"description": "Options for the logging driver.",
"patternProperties": {
"^.+$": {"type": ["string", "number", "null"]}
}
}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
},
"mac_address": {
"type": "string",
"description": "Container MAC address to set."
},
"mem_limit": {
"type": ["number", "string"],
"description": "Memory limit for the container. A string value can use suffix like '2g' for 2 gigabytes."
},
"mem_reservation": {
"type": ["string", "integer"],
"description": "Memory reservation for the container."
},
"mem_swappiness": {
"type": ["integer", "string"],
"description": "Container memory swappiness as percentage (0 to 100)."
},
"memswap_limit": {
"type": ["number", "string"],
"description": "Amount of memory the container is allowed to swap to disk. Set to -1 to enable unlimited swap."
},
"network_mode": {
"type": "string",
"description": "Network mode. Values can be 'bridge', 'host', 'none', 'service:[service name]', or 'container:[container name]'."
},
"models": {
"oneOf": [
{"$ref": "#/definitions/list_of_strings"},
{"type": "object",
"patternProperties": {
"^[a-zA-Z0-9._-]+$": {
"type": "object",
"properties": {
"endpoint_var": {
"type": "string",
"description": "Environment variable set to AI model endpoint."
}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
}
}
}
],
"description": "AI Models to use, referencing entries under the top-level models key."
},
"networks": {
"oneOf": [
{"$ref": "#/definitions/list_of_strings"},
{
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9._-]+$": {
"oneOf": [
{
"type": "object",
"properties": {
"aliases": {
"$ref": "#/definitions/list_of_strings",
"description": "Alternative hostnames for this service on the network."
},
"interface_name": {
"type": "string",
"description": "Interface network name used to connect to network"
},
"ipv4_address": {
"type": "string",
"description": "Specify a static IPv4 address for this service on this network."
},
"ipv6_address": {
"type": "string",
"description": "Specify a static IPv6 address for this service on this network."
},
"link_local_ips": {
"$ref": "#/definitions/list_of_strings",
"description": "List of link-local IPs."
},
"mac_address": {
"type": "string",
"description": "Specify a MAC address for this service on this network."
},
"driver_opts": {
"type": "object",
"description": "Driver options for this network.",
"patternProperties": {
"^.+$": {"type": ["string", "number"]}
}
},
"priority": {
"type": "number",
"description": "Specify the priority for the network connection."
},
"gw_priority": {
"type": "number",
"description": "Specify the gateway priority for the network connection."
}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
},
{"type": "null"}
]
}
},
"additionalProperties": false
}
],
"description": "Networks to join, referencing entries under the top-level networks key. Can be a list of network names or a mapping of network name to network configuration."
},
"oom_kill_disable": {
"type": ["boolean", "string"],
"description": "Disable OOM Killer for the container."
},
"oom_score_adj": {
"oneOf": [
{"type": "string"},
{"type": "integer", "minimum": -1000, "maximum": 1000}
],
"description": "Tune host's OOM preferences for the container (accepts -1000 to 1000)."
},
"pid": {
"type": ["string", "null"],
"description": "PID mode for container."
},
"pids_limit": {
"type": ["number", "string"],
"description": "Tune a container's PIDs limit. Set to -1 for unlimited PIDs."
},
"platform": {
"type": "string",
"description": "Target platform to run on, e.g., 'linux/amd64', 'linux/arm64', or 'windows/amd64'."
},
"ports": {
"type": "array",
"description": "Expose container ports. Short format ([HOST:]CONTAINER[/PROTOCOL]).",
"items": {
"oneOf": [
{"type": "number"},
{"type": "string"},
{
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A human-readable name for this port mapping."
},
"mode": {
"type": "string",
"description": "The port binding mode, either 'host' for publishing a host port or 'ingress' for load balancing."
},
"host_ip": {
"type": "string",
"description": "The host IP to bind to."
},
"target": {
"type": ["integer", "string"],
"description": "The port inside the container."
},
"published": {
"type": ["string", "integer"],
"description": "The publicly exposed port."
},
"protocol": {
"type": "string",
"description": "The port protocol (tcp or udp)."
},
"app_protocol": {
"type": "string",
"description": "Application protocol to use with the port (e.g., http, https, mysql)."
}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
}
]
},
"uniqueItems": true
},
"post_start": {
"type": "array",
"items": {"$ref": "#/definitions/service_hook"},
"description": "Commands to run after the container starts. If any command fails, the container stops."
},
"pre_stop": {
"type": "array",
"items": {"$ref": "#/definitions/service_hook"},
"description": "Commands to run before the container stops. If any command fails, the container stop is aborted."
},
"privileged": {
"type": ["boolean", "string"],
"description": "Give extended privileges to the service container."
},
"profiles": {
"$ref": "#/definitions/list_of_strings",
"description": "List of profiles for this service. When profiles are specified, services are only started when the profile is activated."
},
"pull_policy": {
"type": "string",
"pattern": "always|never|build|if_not_present|missing|refresh|daily|weekly|every_([0-9]+[wdhms])+",
"description": "Policy for pulling images. Options include: 'always', 'never', 'if_not_present', 'missing', 'build', or time-based refresh policies."
},
"pull_refresh_after": {
"type": "string",
"description": "Time after which to refresh the image. Used with pull_policy=refresh."
},
"read_only": {
"type": ["boolean", "string"],
"description": "Mount the container's filesystem as read only."
},
"restart": {
"type": "string",
"description": "Restart policy for the service container. Options include: 'no', 'always', 'on-failure', and 'unless-stopped'."
},
"runtime": {
"type": "string",
"description": "Runtime to use for this container, e.g., 'runc'."
},
"scale": {
"type": ["integer", "string"],
"description": "Number of containers to deploy for this service."
},
"security_opt": {
"type": "array",
"items": {"type": "string"},
"uniqueItems": true,
"description": "Override the default labeling scheme for each container."
},
"shm_size": {
"type": ["number", "string"],
"description": "Size of /dev/shm. A string value can use suffix like '2g' for 2 gigabytes."
},
"secrets": {
"$ref": "#/definitions/service_config_or_secret",
"description": "Grant access to Secrets on a per-service basis."
},
"sysctls": {
"$ref": "#/definitions/list_or_dict",
"description": "Kernel parameters to set in the container. You can use either an array or a list."
},
"stdin_open": {
"type": ["boolean", "string"],
"description": "Keep STDIN open even if not attached."
},
"stop_grace_period": {
"type": "string",
"description": "Time to wait for the container to stop gracefully before sending SIGKILL (e.g., '1s', '1m30s')."
},
"stop_signal": {
"type": "string",
"description": "Signal to stop the container (e.g., 'SIGTERM', 'SIGINT')."
},
"storage_opt": {
"type": "object",
"description": "Storage driver options for the container."
},
"tmpfs": {
"$ref": "#/definitions/string_or_list",
"description": "Mount a temporary filesystem (tmpfs) into the container. Can be a single value or a list."
},
"tty": {
"type": ["boolean", "string"],
"description": "Allocate a pseudo-TTY to service container."
},
"ulimits": {
"$ref": "#/definitions/ulimits",
"description": "Override the default ulimits for a container."
},
"use_api_socket": {
"type": "boolean",
"description": "Bind mount Docker API socket and required auth."
},
"user": {
"type": "string",
"description": "Username or UID to run the container process as."
},
"uts": {
"type": "string",
"description": "UTS namespace to use. 'host' shares the host's UTS namespace."
},
"userns_mode": {
"type": "string",
"description": "User namespace to use. 'host' shares the host's user namespace."
},
"volumes": {
"type": "array",
"description": "Mount host paths or named volumes accessible to the container. Short syntax (VOLUME:CONTAINER_PATH[:MODE])",
"items": {
"oneOf": [
{"type": "string"},
{
"type": "object",
"required": ["type"],
"properties": {
"type": {
"type": "string",
"enum": ["bind", "volume", "tmpfs", "cluster", "npipe", "image"],
"description": "The mount type: bind for mounting host directories, volume for named volumes, tmpfs for temporary filesystems, cluster for cluster volumes, npipe for named pipes, or image for mounting from an image."
},
"source": {
"type": "string",
"description": "The source of the mount, a path on the host for a bind mount, a docker image reference for an image mount, or the name of a volume defined in the top-level volumes key. Not applicable for a tmpfs mount."
},
"target": {
"type": "string",
"description": "The path in the container where the volume is mounted."
},
"read_only": {
"type": ["boolean", "string"],
"description": "Flag to set the volume as read-only."
},
"consistency": {
"type": "string",
"description": "The consistency requirements for the mount. Available values are platform specific."
},
"bind": {
"type": "object",
"description": "Configuration specific to bind mounts.",
"properties": {
"propagation": {
"type": "string",
"description": "The propagation mode for the bind mount: 'shared', 'slave', 'private', 'rshared', 'rslave', or 'rprivate'."
},
"create_host_path": {
"type": ["boolean", "string"],
"description": "Create the host path if it doesn't exist."
},
"recursive": {
"type": "string",
"enum": ["enabled", "disabled", "writable", "readonly"],
"description": "Recursively mount the source directory."
},
"selinux": {
"type": "string",
"enum": ["z", "Z"],
"description": "SELinux relabeling options: 'z' for shared content, 'Z' for private unshared content."
}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
},
"volume": {
"type": "object",
"description": "Configuration specific to volume mounts.",
"properties": {
"labels": {
"$ref": "#/definitions/list_or_dict",
"description": "Labels to apply to the volume."
},
"nocopy": {
"type": ["boolean", "string"],
"description": "Flag to disable copying of data from a container when a volume is created."
},
"subpath": {
"type": "string",
"description": "Path within the volume to mount instead of the volume root."
}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
},
"tmpfs": {
"type": "object",
"description": "Configuration specific to tmpfs mounts.",
"properties": {
"size": {
"oneOf": [
{"type": "integer", "minimum": 0},
{"type": "string"}
],
"description": "Size of the tmpfs mount in bytes."
},
"mode": {
"type": ["number", "string"],
"description": "File mode of the tmpfs in octal."
}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
},
"image": {
"type": "object",
"description": "Configuration specific to image mounts.",
"properties": {
"subpath": {
"type": "string",
"description": "Path within the image to mount instead of the image root."
}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
}
]
},
"uniqueItems": true
},
"volumes_from": {
"type": "array",
"items": {"type": "string"},
"uniqueItems": true,
"description": "Mount volumes from another service or container. Optionally specify read-only access (ro) or read-write (rw)."
},
"working_dir": {
"type": "string",
"description": "The working directory in which the entrypoint or command will be run"
}
},
"patternProperties": {"^x-": {}},
"additionalProperties": false
},
"healthcheck": {
"type": "object",
"description": "Configuration options to determine whether the container is healthy.",
"properties": {
"disable": {
"type": ["boolean", "string"],
"description": "Disable any container-specified healthcheck. Set to true to disable."
},
"interval": {
"type": "string",
"description": "Time between running the check (e.g., '1s', '1m30s'). Default: 30s."
},
"retries": {
"type": ["number", "string"],
"description": "Number of consecutive failures needed to consider the container as unhealthy. Default: 3."
},
"test": {
"oneOf": [
{"type": "string"},
{"type": "array", "items": {"type": "string"}}
],
"description": "The test to perform to check container health. Can be a string or a list. The first item is either NONE, CMD, or CMD-SHELL. If it's CMD, the rest of the command is exec'd. If it's CMD-SHELL, the rest is run in the shell."
},
"timeout": {
"type": "string",
"description": "Maximum time to allow one check to run (e.g., '1s', '1m30s'). Default: 30s."
},
"start_period": {
"type": "string",
"description": "Start period for the container to initialize before starting health-retries countdown (e.g., '1s', '1m30s'). Default: 0s."
},
"start_interval": {
"type": "string",
"description": "Time between running the check during the start period (e.g., '1s', '1m30s'). Default: interval value."
}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
},
"development": {
"type": ["object", "null"],
"description": "Development configuration for the service, used for development workflows.",
"properties": {
"watch": {
"type": "array",
"description": "Configure watch mode for the service, which monitors file changes and performs actions in response.",
"items": {
"type": "object",
"required": ["path", "action"],
"properties": {
"ignore": {
"$ref": "#/definitions/string_or_list",
"description": "Patterns to exclude from watching."
},
"include": {
"$ref": "#/definitions/string_or_list",
"description": "Patterns to include in watching."
},
"path": {
"type": "string",
"description": "Path to watch for changes."
},
"action": {
"type": "string",
"enum": ["rebuild", "sync", "restart", "sync+restart", "sync+exec"],
"description": "Action to take when a change is detected: rebuild the container, sync files, restart the container, sync and restart, or sync and execute a command."
},
"target": {
"type": "string",
"description": "Target path in the container for sync operations."
},
"exec": {
"$ref": "#/definitions/service_hook",
"description": "Command to execute when a change is detected and action is sync+exec."
}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
}
}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
},
"deployment": {
"type": ["object", "null"],
"description": "Deployment configuration for the service.",