{
    "additionalProperties": false,
    "definitions": {
        "constraints": {
            "service": {
                "anyOf": [
                    {
                        "not": {
                            "required": [
                                "image"
                            ]
                        },
                        "required": [
                            "build"
                        ]
                    },
                    {
                        "not": {
                            "anyOf": [
                                {
                                    "required": [
                                        "build"
                                    ]
                                },
                                {
                                    "required": [
                                        "dockerfile"
                                    ]
                                }
                            ]
                        },
                        "required": [
                            "image"
                        ]
                    }
                ],
                "id": "#/definitions/constraints/service"
            }
        },
        "list_of_strings": {
            "items": {
                "type": "string"
            },
            "type": "array",
            "_uniqueItems": true
        },
        "list_or_dict": {
            "oneOf": [
                {
                    "additionalProperties": false,
                    "patternProperties": {
                        ".+": {
                            "type": [
                                "string",
                                "number",
                                "null",
                                "boolean"
                            ]
                        }
                    },
                    "type": "object"
                },
                {
                    "items": {
                        "type": "string"
                    },
                    "type": "array",
                    "_uniqueItems": true
                }
            ]
        },
        "service": {
            "additionalProperties": false,
            "dependencies": {
                "memswap_limit": [
                    "mem_limit"
                ]
            },
            "id": "#/definitions/service",
            "properties": {
                "blkio_weight": {
                    "type": [
                        "number",
                        "string"
                    ]
                },
                "blkio_weight_device": {
                    "$ref": "#/definitions/list_of_strings"
                },
                "build": {
                    "type": "string"
                },
                "cap_add": {
                    "items": {
                        "type": "string"
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "cap_drop": {
                    "items": {
                        "type": "string"
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "certs": {
                    "$ref": "#/definitions/list_of_strings"
                },
                "cgroup_parent": {
                    "type": "string"
                },
                "command": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "items": {
                                "type": "string"
                            },
                            "type": "array"
                        }
                    ]
                },
                "container_name": {
                    "type": "string"
                },
                "cpu_period": {
                    "type": [
                        "number",
                        "string"
                    ]
                },
                "cpu_quota": {
                    "type": [
                        "number",
                        "string"
                    ]
                },
                "cpu_shares": {
                    "type": [
                        "number",
                        "string"
                    ]
                },
                "cpuset": {
                    "type": "string"
                },
                "default_cert": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "device_read_bps": {
                    "$ref": "#/definitions/list_or_dict"
                },
                "device_read_iops": {
                    "$ref": "#/definitions/list_or_dict"
                },
                "device_write_bps": {
                    "$ref": "#/definitions/list_or_dict"
                },
                "device_write_iops": {
                    "$ref": "#/definitions/list_or_dict"
                },
                "devices": {
                    "items": {
                        "type": "string"
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "disks": {
                    "type": "array"
                },
                "dns": {
                    "$ref": "#/definitions/string_or_list"
                },
                "dns_opt": {
                    "$ref": "#/definitions/list_or_dict"
                },
                "dns_search": {
                    "$ref": "#/definitions/string_or_list"
                },
                "dockerfile": {
                    "type": "string"
                },
                "domainname": {
                    "type": "string"
                },
                "entrypoint": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "items": {
                                "type": "string"
                            },
                            "type": "array"
                        }
                    ]
                },
                "env_file": {
                    "$ref": "#/definitions/string_or_list"
                },
                "environment": {
                    "$ref": "#/definitions/list_or_dict"
                },
                "expose": {
                    "items": {
                        "format": "expose",
                        "type": [
                            "string",
                            "number"
                        ]
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "extends": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "additionalProperties": false,
                            "properties": {
                                "file": {
                                    "type": "string"
                                },
                                "service": {
                                    "type": "string"
                                }
                            },
                            "required": [
                                "service"
                            ],
                            "type": "object"
                        }
                    ]
                },
                "external_ips": {
                    "$ref": "#/definitions/list_of_strings"
                },
                "external_links": {
                    "items": {
                        "type": "string"
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "extra_hosts": {
                    "$ref": "#/definitions/list_or_dict"
                },
                "group_add": {
                    "items": {
                        "type": [
                            "string",
                            "number"
                        ]
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "health_check": {
                    "type": "object"
                },
                "hostname": {
                    "type": "string"
                },
                "image": {
                    "type": "string"
                },
                "init": {
                    "type": "boolean"
                },
                "ipc": {
                    "type": "string"
                },
                "isolation": {
                    "type": "string"
                },
                "labels": {
                    "$ref": "#/definitions/list_or_dict"
                },
                "lb_config": {
                    "type": "object"
                },
                "links": {
                    "items": {
                        "type": "string"
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "load_balancer_config": {
                    "type": "object"
                },
                "log_driver": {
                    "type": "string"
                },
                "log_opt": {
                    "type": "object"
                },
                "mac_address": {
                    "type": "string"
                },
                "mem_limit": {
                    "type": [
                        "number",
                        "string"
                    ]
                },
                "mem_reservation": {
                    "type": [
                        "number",
                        "string"
                    ]
                },
                "mem_swappiness": {
                    "type": "integer"
                },
                "memory": {
                    "type": [
                        "number",
                        "string"
                    ]
                },
                "memswap_limit": {
                    "type": [
                        "number",
                        "string"
                    ]
                },
                "metadata": {
                    "type": "object"
                },
                "net": {
                    "type": "string"
                },
                "network_driver": {
                    "type": "object"
                },
                "oom_kill_disable": {
                    "type": "boolean"
                },
                "oom_score_adj": {
                    "maximum": 1000,
                    "minimum": -1000,
                    "type": "integer"
                },
                "pid": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "ports": {
                    "items": {
                        "format": "ports",
                        "type": [
                            "string",
                            "number"
                        ]
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "privileged": {
                    "type": "boolean"
                },
                "read_only": {
                    "type": "boolean"
                },
                "restart": {
                    "type": "string"
                },
                "retain_ip": {
                    "type": "boolean"
                },
                "scale": {
                    "type": [
                        "number",
                        "string"
                    ]
                },
                "scale_policy": {
                    "type": "object"
                },
                "security_opt": {
                    "items": {
                        "type": "string"
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "shm_size": {
                    "type": [
                        "number",
                        "string"
                    ]
                },
                "start_on_create": {
                    "type": "boolean"
                },
                "stdin_open": {
                    "type": "boolean"
                },
                "stop_signal": {
                    "type": "string"
                },
                "storage_driver": {
                    "type": "object"
                },
                "sysctls": {
                    "$ref": "#/definitions/list_or_dict"
                },
                "tty": {
                    "type": "boolean"
                },
                "type": {
                    "type": "string"
                },
                "ulimits": {
                    "patternProperties": {
                        "^[a-z]+$": {
                            "oneOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "additionalProperties": false,
                                    "properties": {
                                        "hard": {
                                            "type": "integer"
                                        },
                                        "soft": {
                                            "type": "integer"
                                        }
                                    },
                                    "required": [
                                        "soft",
                                        "hard"
                                    ],
                                    "type": "object"
                                }
                            ]
                        }
                    },
                    "type": "object"
                },
                "upgrade_strategy": {
                    "type": "object"
                },
                "user": {
                    "type": "string"
                },
                "userdata": {
                    "type": "string"
                },
                "uts": {
                    "type": "string"
                },
                "vcpu": {
                    "type": [
                        "number",
                        "string"
                    ]
                },
                "volume_driver": {
                    "type": "string"
                },
                "volumes": {
                    "items": {
                        "type": "string"
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "volumes_from": {
                    "items": {
                        "type": "string"
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "working_dir": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "string_or_list": {
            "oneOf": [
                {
                    "type": "string"
                },
                {
                    "$ref": "#/definitions/list_of_strings"
                }
            ]
        }
    },
    "patternProperties": {
        "^[a-zA-Z0-9._-]+$": {
            "$ref": "#/definitions/service"
        }
    },
    "type": "object"
}