config_schema_v2.3.json 14 KB

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