config_schema_v3.1.json 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. {
  2. "$schema": "http://json-schema.org/draft-04/schema#",
  3. "id": "config_schema_v3.1.json",
  4. "type": "object",
  5. "required": ["version"],
  6. "properties": {
  7. "version": {
  8. "type": "string"
  9. },
  10. "services": {
  11. "id": "#/properties/services",
  12. "type": "object",
  13. "patternProperties": {
  14. "^[a-zA-Z0-9._-]+$": {
  15. "$ref": "#/definitions/service"
  16. }
  17. },
  18. "additionalProperties": false
  19. },
  20. "networks": {
  21. "id": "#/properties/networks",
  22. "type": "object",
  23. "patternProperties": {
  24. "^[a-zA-Z0-9._-]+$": {
  25. "$ref": "#/definitions/network"
  26. }
  27. }
  28. },
  29. "volumes": {
  30. "id": "#/properties/volumes",
  31. "type": "object",
  32. "patternProperties": {
  33. "^[a-zA-Z0-9._-]+$": {
  34. "$ref": "#/definitions/volume"
  35. }
  36. },
  37. "additionalProperties": false
  38. },
  39. "secrets": {
  40. "id": "#/properties/secrets",
  41. "type": "object",
  42. "patternProperties": {
  43. "^[a-zA-Z0-9._-]+$": {
  44. "$ref": "#/definitions/secret"
  45. }
  46. },
  47. "additionalProperties": false
  48. }
  49. },
  50. "additionalProperties": false,
  51. "definitions": {
  52. "service": {
  53. "id": "#/definitions/service",
  54. "type": "object",
  55. "properties": {
  56. "deploy": {"$ref": "#/definitions/deployment"},
  57. "build": {
  58. "oneOf": [
  59. {"type": "string"},
  60. {
  61. "type": "object",
  62. "properties": {
  63. "context": {"type": "string"},
  64. "dockerfile": {"type": "string"},
  65. "args": {"$ref": "#/definitions/list_or_dict"}
  66. },
  67. "additionalProperties": false
  68. }
  69. ]
  70. },
  71. "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  72. "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  73. "cgroup_parent": {"type": "string"},
  74. "command": {
  75. "oneOf": [
  76. {"type": "string"},
  77. {"type": "array", "items": {"type": "string"}}
  78. ]
  79. },
  80. "container_name": {"type": "string"},
  81. "depends_on": {"$ref": "#/definitions/list_of_strings"},
  82. "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  83. "dns": {"$ref": "#/definitions/string_or_list"},
  84. "dns_search": {"$ref": "#/definitions/string_or_list"},
  85. "domainname": {"type": "string"},
  86. "entrypoint": {
  87. "oneOf": [
  88. {"type": "string"},
  89. {"type": "array", "items": {"type": "string"}}
  90. ]
  91. },
  92. "env_file": {"$ref": "#/definitions/string_or_list"},
  93. "environment": {"$ref": "#/definitions/list_or_dict"},
  94. "expose": {
  95. "type": "array",
  96. "items": {
  97. "type": ["string", "number"],
  98. "format": "expose"
  99. },
  100. "uniqueItems": true
  101. },
  102. "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  103. "extra_hosts": {"$ref": "#/definitions/list_or_dict"},
  104. "healthcheck": {"$ref": "#/definitions/healthcheck"},
  105. "hostname": {"type": "string"},
  106. "image": {"type": "string"},
  107. "ipc": {"type": "string"},
  108. "labels": {"$ref": "#/definitions/labels"},
  109. "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  110. "logging": {
  111. "type": "object",
  112. "properties": {
  113. "driver": {"type": "string"},
  114. "options": {
  115. "type": "object",
  116. "patternProperties": {
  117. "^.+$": {"type": ["string", "number", "null"]}
  118. }
  119. }
  120. },
  121. "additionalProperties": false
  122. },
  123. "mac_address": {"type": "string"},
  124. "network_mode": {"type": "string"},
  125. "networks": {
  126. "oneOf": [
  127. {"$ref": "#/definitions/list_of_strings"},
  128. {
  129. "type": "object",
  130. "patternProperties": {
  131. "^[a-zA-Z0-9._-]+$": {
  132. "oneOf": [
  133. {
  134. "type": "object",
  135. "properties": {
  136. "aliases": {"$ref": "#/definitions/list_of_strings"},
  137. "ipv4_address": {"type": "string"},
  138. "ipv6_address": {"type": "string"}
  139. },
  140. "additionalProperties": false
  141. },
  142. {"type": "null"}
  143. ]
  144. }
  145. },
  146. "additionalProperties": false
  147. }
  148. ]
  149. },
  150. "pid": {"type": ["string", "null"]},
  151. "ports": {
  152. "type": "array",
  153. "items": {
  154. "type": ["string", "number"],
  155. "format": "ports"
  156. },
  157. "uniqueItems": true
  158. },
  159. "privileged": {"type": "boolean"},
  160. "read_only": {"type": "boolean"},
  161. "restart": {"type": "string"},
  162. "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  163. "shm_size": {"type": ["number", "string"]},
  164. "secrets": {
  165. "type": "array",
  166. "items": {
  167. "oneOf": [
  168. {"type": "string"},
  169. {
  170. "type": "object",
  171. "properties": {
  172. "source": {"type": "string"},
  173. "target": {"type": "string"},
  174. "uid": {"type": "string"},
  175. "gid": {"type": "string"},
  176. "mode": {"type": "number"}
  177. }
  178. }
  179. ]
  180. }
  181. },
  182. "sysctls": {"$ref": "#/definitions/list_or_dict"},
  183. "stdin_open": {"type": "boolean"},
  184. "stop_grace_period": {"type": "string", "format": "duration"},
  185. "stop_signal": {"type": "string"},
  186. "tmpfs": {"$ref": "#/definitions/string_or_list"},
  187. "tty": {"type": "boolean"},
  188. "ulimits": {
  189. "type": "object",
  190. "patternProperties": {
  191. "^[a-z]+$": {
  192. "oneOf": [
  193. {"type": "integer"},
  194. {
  195. "type":"object",
  196. "properties": {
  197. "hard": {"type": "integer"},
  198. "soft": {"type": "integer"}
  199. },
  200. "required": ["soft", "hard"],
  201. "additionalProperties": false
  202. }
  203. ]
  204. }
  205. }
  206. },
  207. "user": {"type": "string"},
  208. "userns_mode": {"type": "string"},
  209. "volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  210. "working_dir": {"type": "string"}
  211. },
  212. "additionalProperties": false
  213. },
  214. "healthcheck": {
  215. "id": "#/definitions/healthcheck",
  216. "type": "object",
  217. "additionalProperties": false,
  218. "properties": {
  219. "disable": {"type": "boolean"},
  220. "interval": {"type": "string"},
  221. "retries": {"type": "number"},
  222. "test": {
  223. "oneOf": [
  224. {"type": "string"},
  225. {"type": "array", "items": {"type": "string"}}
  226. ]
  227. },
  228. "timeout": {"type": "string"}
  229. }
  230. },
  231. "deployment": {
  232. "id": "#/definitions/deployment",
  233. "type": ["object", "null"],
  234. "properties": {
  235. "mode": {"type": "string"},
  236. "replicas": {"type": "integer"},
  237. "labels": {"$ref": "#/definitions/labels"},
  238. "update_config": {
  239. "type": "object",
  240. "properties": {
  241. "parallelism": {"type": "integer"},
  242. "delay": {"type": "string", "format": "duration"},
  243. "failure_action": {"type": "string"},
  244. "monitor": {"type": "string", "format": "duration"},
  245. "max_failure_ratio": {"type": "number"}
  246. },
  247. "additionalProperties": false
  248. },
  249. "resources": {
  250. "type": "object",
  251. "properties": {
  252. "limits": {"$ref": "#/definitions/resource"},
  253. "reservations": {"$ref": "#/definitions/resource"}
  254. },
  255. "additionalProperties": false
  256. },
  257. "restart_policy": {
  258. "type": "object",
  259. "properties": {
  260. "condition": {"type": "string"},
  261. "delay": {"type": "string", "format": "duration"},
  262. "max_attempts": {"type": "integer"},
  263. "window": {"type": "string", "format": "duration"}
  264. },
  265. "additionalProperties": false
  266. },
  267. "placement": {
  268. "type": "object",
  269. "properties": {
  270. "constraints": {"type": "array", "items": {"type": "string"}}
  271. },
  272. "additionalProperties": false
  273. }
  274. },
  275. "additionalProperties": false
  276. },
  277. "resource": {
  278. "id": "#/definitions/resource",
  279. "type": "object",
  280. "properties": {
  281. "cpus": {"type": "string"},
  282. "memory": {"type": "string"}
  283. },
  284. "additionalProperties": false
  285. },
  286. "network": {
  287. "id": "#/definitions/network",
  288. "type": ["object", "null"],
  289. "properties": {
  290. "driver": {"type": "string"},
  291. "driver_opts": {
  292. "type": "object",
  293. "patternProperties": {
  294. "^.+$": {"type": ["string", "number"]}
  295. }
  296. },
  297. "ipam": {
  298. "type": "object",
  299. "properties": {
  300. "driver": {"type": "string"},
  301. "config": {
  302. "type": "array",
  303. "items": {
  304. "type": "object",
  305. "properties": {
  306. "subnet": {"type": "string", "format": "subnet_ip_address"}
  307. },
  308. "additionalProperties": false
  309. }
  310. }
  311. },
  312. "additionalProperties": false
  313. },
  314. "external": {
  315. "type": ["boolean", "object"],
  316. "properties": {
  317. "name": {"type": "string"}
  318. },
  319. "additionalProperties": false
  320. },
  321. "internal": {"type": "boolean"},
  322. "labels": {"$ref": "#/definitions/labels"}
  323. },
  324. "additionalProperties": false
  325. },
  326. "volume": {
  327. "id": "#/definitions/volume",
  328. "type": ["object", "null"],
  329. "properties": {
  330. "driver": {"type": "string"},
  331. "driver_opts": {
  332. "type": "object",
  333. "patternProperties": {
  334. "^.+$": {"type": ["string", "number"]}
  335. }
  336. },
  337. "external": {
  338. "type": ["boolean", "object"],
  339. "properties": {
  340. "name": {"type": "string"}
  341. },
  342. "additionalProperties": false
  343. },
  344. "labels": {"$ref": "#/definitions/labels"}
  345. },
  346. "additionalProperties": false
  347. },
  348. "secret": {
  349. "id": "#/definitions/secret",
  350. "type": "object",
  351. "properties": {
  352. "file": {"type": "string"},
  353. "external": {
  354. "type": ["boolean", "object"],
  355. "properties": {
  356. "name": {"type": "string"}
  357. }
  358. },
  359. "labels": {"$ref": "#/definitions/labels"}
  360. },
  361. "additionalProperties": false
  362. },
  363. "string_or_list": {
  364. "oneOf": [
  365. {"type": "string"},
  366. {"$ref": "#/definitions/list_of_strings"}
  367. ]
  368. },
  369. "list_of_strings": {
  370. "type": "array",
  371. "items": {"type": "string"},
  372. "uniqueItems": true
  373. },
  374. "list_or_dict": {
  375. "oneOf": [
  376. {
  377. "type": "object",
  378. "patternProperties": {
  379. ".+": {
  380. "type": ["string", "number", "null"]
  381. }
  382. },
  383. "additionalProperties": false
  384. },
  385. {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
  386. ]
  387. },
  388. "labels": {
  389. "oneOf": [
  390. {
  391. "type": "object",
  392. "patternProperties": {
  393. ".+": {
  394. "type": "string"
  395. }
  396. },
  397. "additionalProperties": false
  398. },
  399. {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
  400. ]
  401. },
  402. "constraints": {
  403. "service": {
  404. "id": "#/definitions/constraints/service",
  405. "anyOf": [
  406. {"required": ["build"]},
  407. {"required": ["image"]}
  408. ],
  409. "properties": {
  410. "build": {
  411. "required": ["context"]
  412. }
  413. }
  414. }
  415. }
  416. }
  417. }