Skip to content

Commit

Permalink
feat(schema): update docker compose schema from source
Browse files Browse the repository at this point in the history
  • Loading branch information
zavoloklom committed Nov 22, 2024
1 parent c612468 commit f4e0a36
Showing 1 changed file with 64 additions and 9 deletions.
73 changes: 64 additions & 9 deletions schemas/compose.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"include": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/include"
},
"description": "compose sub-projects to be included."
Expand Down Expand Up @@ -115,7 +114,7 @@
"pull": {"type": ["boolean", "string"]},
"target": {"type": "string"},
"shm_size": {"type": ["integer", "string"]},
"extra_hosts": {"$ref": "#/definitions/list_or_dict"},
"extra_hosts": {"$ref": "#/definitions/extra_hosts"},
"isolation": {"type": "string"},
"privileged": {"type": ["boolean", "string"]},
"secrets": {"$ref": "#/definitions/service_config_or_secret"},
Expand Down Expand Up @@ -216,7 +215,25 @@
]
},
"device_cgroup_rules": {"$ref": "#/definitions/list_of_strings"},
"devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
"devices": {
"type": "array",
"items": {
"oneOf": [
{"type": "string"},
{
"type": "object",
"required": ["source"],
"properties": {
"source": {"type": "string"},
"target": {"type": "string"},
"permissions": {"type": "string"}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
}
]
}
},
"dns": {"$ref": "#/definitions/string_or_list"},
"dns_opt": {"type": "array","items": {"type": "string"}, "uniqueItems": true},
"dns_search": {"$ref": "#/definitions/string_or_list"},
Expand Down Expand Up @@ -249,7 +266,7 @@
]
},
"external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
"extra_hosts": {"$ref": "#/definitions/list_or_dict"},
"extra_hosts": {"$ref": "#/definitions/extra_hosts"},
"group_add": {
"type": "array",
"items": {
Expand Down Expand Up @@ -353,6 +370,8 @@
},
"uniqueItems": true
},
"post_start": {"type": "array", "items": {"$ref": "#/definitions/service_hook"}},
"pre_stop": {"type": "array", "items": {"$ref": "#/definitions/service_hook"}},
"privileged": {"type": ["boolean", "string"]},
"profiles": {"$ref": "#/definitions/list_of_strings"},
"pull_policy": {"type": "string", "enum": [
Expand Down Expand Up @@ -483,11 +502,11 @@
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
}
}
}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
},
"deployment": {
"id": "#/definitions/deployment",
Expand Down Expand Up @@ -625,7 +644,10 @@
"options":{"$ref": "#/definitions/list_or_dict"}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
"patternProperties": {"^x-": {}},
"required": [
"capabilities"
]
}
},

Expand Down Expand Up @@ -796,6 +818,20 @@
]
},

"service_hook": {
"id": "#/definitions/service_hook",
"type": "object",
"properties": {
"command": {"$ref": "#/definitions/command"},
"user": {"type": "string"},
"privileged": {"type": ["boolean", "string"]},
"working_dir": {"type": "string"},
"environment": {"$ref": "#/definitions/list_or_dict"}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
},

"env_file": {
"oneOf": [
{"type": "string"},
Expand All @@ -811,6 +847,9 @@
"path": {
"type": "string"
},
"format": {
"type": "string"
},
"required": {
"type": ["boolean", "string"],
"default": true
Expand Down Expand Up @@ -854,6 +893,22 @@
]
},

"extra_hosts": {
"oneOf": [
{
"type": "object",
"patternProperties": {
".+": {
"type": ["string", "array"]
},
"uniqueItems": false
},
"additionalProperties": false
},
{"type": "array", "items": {"type": "string"}, "uniqueItems": true}
]
},

"blkio_limit": {
"type": "object",
"properties": {
Expand Down

0 comments on commit f4e0a36

Please sign in to comment.