Skip to content

Commit c010f5f

Browse files
committed
Add descriptive documentation to compose schema properties
Signed-off-by: testA113 <[email protected]>
1 parent ca961cc commit c010f5f

File tree

1 file changed

+39
-28
lines changed

1 file changed

+39
-28
lines changed

schema/compose-spec.json

+39-28
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"$ref": "#/definitions/service"
3232
}
3333
},
34-
"additionalProperties": false
34+
"additionalProperties": false,
35+
"description": "The services in your project"
3536
},
3637

3738
"networks": {
@@ -40,7 +41,8 @@
4041
"^[a-zA-Z0-9._-]+$": {
4142
"$ref": "#/definitions/network"
4243
}
43-
}
44+
},
45+
"description": "Networks that are shared among multiple services"
4446
},
4547

4648
"volumes": {
@@ -50,7 +52,8 @@
5052
"$ref": "#/definitions/volume"
5153
}
5254
},
53-
"additionalProperties": false
55+
"additionalProperties": false,
56+
"description": "Named volumes that are shared among multiple services"
5457
},
5558

5659
"secrets": {
@@ -60,7 +63,8 @@
6063
"$ref": "#/definitions/secret"
6164
}
6265
},
63-
"additionalProperties": false
66+
"additionalProperties": false,
67+
"description": "Secrets that are shared among multiple services"
6468
},
6569

6670
"configs": {
@@ -70,7 +74,8 @@
7074
"$ref": "#/definitions/config"
7175
}
7276
},
73-
"additionalProperties": false
77+
"additionalProperties": false,
78+
"description": "Configurations for services in the project"
7479
}
7580
},
7681

@@ -93,11 +98,11 @@
9398
{
9499
"type": "object",
95100
"properties": {
96-
"context": {"type": "string"},
97-
"dockerfile": {"type": "string"},
101+
"context": {"type": "string", "description": "The context used for building the image"},
102+
"dockerfile": {"type": "string", "description": "The Dockerfile used for building the image"},
98103
"dockerfile_inline": {"type": "string"},
99104
"entitlements": {"type": "array", "items": {"type": "string"}},
100-
"args": {"$ref": "#/definitions/list_or_dict"},
105+
"args": {"$ref": "#/definitions/list_or_dict", "description": "Arguments used during the image build process"},
101106
"ssh": {"$ref": "#/definitions/list_or_dict"},
102107
"labels": {"$ref": "#/definitions/list_or_dict"},
103108
"cache_from": {"type": "array", "items": {"type": "string"}},
@@ -152,9 +157,9 @@
152157
"cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
153158
"cgroup": {"type": "string", "enum": ["host", "private"]},
154159
"cgroup_parent": {"type": "string"},
155-
"command": {"$ref": "#/definitions/command"},
160+
"command": {"$ref": "#/definitions/command", "description": "The command that will be run in the container"},
156161
"configs": {"$ref": "#/definitions/service_config_or_secret"},
157-
"container_name": {"type": "string"},
162+
"container_name": {"type": "string", "description": "The name that will be given to the container"},
158163
"cpu_count": {"oneOf": [
159164
{"type": "string"},
160165
{"type": "integer", "minimum": 0}
@@ -206,7 +211,8 @@
206211
}
207212
}
208213
}
209-
]
214+
],
215+
"description": "Other services that this service depends on, which will be started before this one"
210216
},
211217
"device_cgroup_rules": {"$ref": "#/definitions/list_of_strings"},
212218
"devices": {
@@ -232,17 +238,18 @@
232238
"dns_opt": {"type": "array","items": {"type": "string"}, "uniqueItems": true},
233239
"dns_search": {"$ref": "#/definitions/string_or_list"},
234240
"domainname": {"type": "string"},
235-
"entrypoint": {"$ref": "#/definitions/command"},
236-
"env_file": {"$ref": "#/definitions/env_file"},
241+
"entrypoint": {"$ref": "#/definitions/command", "description": "The entrypoint to the application in the container"},
242+
"env_file": {"$ref": "#/definitions/env_file", "description": "Files containing environment variables that will be included"},
237243
"label_file": {"$ref": "#/definitions/label_file"},
238-
"environment": {"$ref": "#/definitions/list_or_dict"},
244+
"environment": {"$ref": "#/definitions/list_or_dict", "description": "Environment variables that will be included"},
239245

240246
"expose": {
241247
"type": "array",
242248
"items": {
243249
"type": ["string", "number"]
244250
},
245-
"uniqueItems": true
251+
"uniqueItems": true,
252+
"description": "Ports exposed to the other services but not to the host machine"
246253
},
247254
"extends": {
248255
"oneOf": [
@@ -283,13 +290,13 @@
283290
},
284291
"uniqueItems": true
285292
},
286-
"healthcheck": {"$ref": "#/definitions/healthcheck"},
293+
"healthcheck": {"$ref": "#/definitions/healthcheck", "description": "A command for checking if the container is healthy"},
287294
"hostname": {"type": "string"},
288-
"image": {"type": "string"},
295+
"image": {"type": "string", "description": "The image that will be pulled for the service. If `build` is specified, the built image will be given this tag."},
289296
"init": {"type": ["boolean", "string"]},
290297
"ipc": {"type": "string"},
291298
"isolation": {"type": "string"},
292-
"labels": {"$ref": "#/definitions/list_or_dict"},
299+
"labels": {"$ref": "#/definitions/list_or_dict", "description": "Labels that will be given to the container"},
293300
"links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
294301
"logging": {
295302
"type": "object",
@@ -303,7 +310,8 @@
303310
}
304311
},
305312
"additionalProperties": false,
306-
"patternProperties": {"^x-": {}}
313+
"patternProperties": {"^x-": {}},
314+
"description": "Settings for logging for this service"
307315
},
308316
"mac_address": {"type": "string"},
309317
"mem_limit": {"type": ["number", "string"]},
@@ -346,7 +354,8 @@
346354
},
347355
"additionalProperties": false
348356
}
349-
]
357+
],
358+
"description": "The service will be included in these networks, allowing it to reach other containers on the same network"
350359
},
351360
"oom_kill_disable": {"type": ["boolean", "string"]},
352361
"oom_score_adj": {"oneOf": [
@@ -378,12 +387,13 @@
378387
}
379388
]
380389
},
381-
"uniqueItems": true
390+
"uniqueItems": true,
391+
"description": "Ports that will be exposed to the host"
382392
},
383393
"post_start": {"type": "array", "items": {"$ref": "#/definitions/service_hook"}},
384394
"pre_stop": {"type": "array", "items": {"$ref": "#/definitions/service_hook"}},
385395
"privileged": {"type": ["boolean", "string"]},
386-
"profiles": {"$ref": "#/definitions/list_of_strings"},
396+
"profiles": {"$ref": "#/definitions/list_of_strings", "description": "Profiles that this service is a part of. When the profile is started, this service will be started."},
387397
"pull_policy": {"type": "string",
388398
"pattern": "always|never|build|if_not_present|missing|refresh|daily|weekly|every_([0-9]+[wdhms])+"
389399
},
@@ -398,7 +408,7 @@
398408
},
399409
"security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
400410
"shm_size": {"type": ["number", "string"]},
401-
"secrets": {"$ref": "#/definitions/service_config_or_secret"},
411+
"secrets": {"$ref": "#/definitions/service_config_or_secret", "description": "Secrets the service will have access to"},
402412
"sysctls": {"$ref": "#/definitions/list_or_dict"},
403413
"stdin_open": {"type": ["boolean", "string"]},
404414
"stop_grace_period": {"type": "string"},
@@ -407,7 +417,7 @@
407417
"tmpfs": {"$ref": "#/definitions/string_or_list"},
408418
"tty": {"type": ["boolean", "string"]},
409419
"ulimits": {"$ref": "#/definitions/ulimits"},
410-
"user": {"type": "string"},
420+
"user": {"type": "string", "description": "The username under which the app in the container will be started"},
411421
"uts": {"type": "string"},
412422
"userns_mode": {"type": "string"},
413423
"volumes": {
@@ -475,14 +485,15 @@
475485
}
476486
]
477487
},
478-
"uniqueItems": true
488+
"uniqueItems": true,
489+
"description": "Named volumes and paths on the host mapped to paths in the container"
479490
},
480491
"volumes_from": {
481492
"type": "array",
482493
"items": {"type": "string"},
483494
"uniqueItems": true
484495
},
485-
"working_dir": {"type": "string"}
496+
"working_dir": {"type": "string", "description": "The working directory in which the entrypoint or command will be run"}
486497
},
487498
"patternProperties": {"^x-": {}},
488499
"additionalProperties": false
@@ -710,7 +721,7 @@
710721
"type": ["object", "null"],
711722
"properties": {
712723
"name": {"type": "string"},
713-
"driver": {"type": "string"},
724+
"driver": {"type": "string", "description": "The driver used for this network"},
714725
"driver_opts": {
715726
"type": "object",
716727
"patternProperties": {
@@ -773,7 +784,7 @@
773784
"type": ["object", "null"],
774785
"properties": {
775786
"name": {"type": "string"},
776-
"driver": {"type": "string"},
787+
"driver": {"type": "string", "description": "The driver used for this volume"},
777788
"driver_opts": {
778789
"type": "object",
779790
"patternProperties": {

0 commit comments

Comments
 (0)