|
88 | 88 | }, |
89 | 89 | "additionalProperties": false, |
90 | 90 | "description": "Configurations that are shared among multiple services." |
| 91 | + }, |
| 92 | + |
| 93 | + "jobs": { |
| 94 | + "type": "object", |
| 95 | + "patternProperties": { |
| 96 | + "^[a-zA-Z0-9._-]+$": { |
| 97 | + "$ref": "#/$defs/job" |
| 98 | + } |
| 99 | + }, |
| 100 | + "additionalProperties": false, |
| 101 | + "description": "Jobs are containers that run to completion, triggered manually or on a schedule." |
91 | 102 | } |
92 | 103 | }, |
93 | 104 |
|
|
96 | 107 |
|
97 | 108 | "$defs": { |
98 | 109 |
|
99 | | - "service": { |
| 110 | + "container_spec": { |
100 | 111 | "type": "object", |
101 | | - "description": "Configuration for a service.", |
| 112 | + "description": "Reusable container specification shared by services, jobs, and other container types.", |
102 | 113 | "properties": { |
103 | | - "develop": {"$ref": "#/$defs/development"}, |
104 | | - "deploy": {"$ref": "#/$defs/deployment"}, |
105 | 114 | "annotations": {"$ref": "#/$defs/list_or_dict"}, |
106 | 115 | "attach": {"type": ["boolean", "string"]}, |
107 | 116 | "build": { |
|
702 | 711 | "type": ["boolean", "string"], |
703 | 712 | "description": "Give extended privileges to the service container." |
704 | 713 | }, |
705 | | - "profiles": { |
706 | | - "$ref": "#/$defs/list_of_strings", |
707 | | - "description": "List of profiles for this service. When profiles are specified, services are only started when the profile is activated." |
708 | | - }, |
709 | 714 | "pull_policy": { |
710 | 715 | "type": "string", |
711 | 716 | "pattern": "always|never|build|if_not_present|missing|refresh|daily|weekly|every_([0-9]+[wdhms])+", |
|
727 | 732 | "type": "string", |
728 | 733 | "description": "Runtime to use for this container, e.g., 'runc'." |
729 | 734 | }, |
730 | | - "scale": { |
731 | | - "type": ["integer", "string"], |
732 | | - "description": "Number of containers to deploy for this service." |
733 | | - }, |
734 | 735 | "security_opt": { |
735 | 736 | "type": "array", |
736 | 737 | "items": {"type": "string"}, |
|
920 | 921 | "description": "The working directory in which the entrypoint or command will be run" |
921 | 922 | } |
922 | 923 | }, |
923 | | - "patternProperties": {"^x-": {}}, |
924 | | - "additionalProperties": false |
| 924 | + "patternProperties": {"^x-": {}} |
| 925 | + }, |
| 926 | + |
| 927 | + "service": { |
| 928 | + "description": "Configuration for a service.", |
| 929 | + "allOf": [{"$ref": "#/$defs/container_spec"}], |
| 930 | + "properties": { |
| 931 | + "deploy": {"$ref": "#/$defs/deployment"}, |
| 932 | + "develop": {"$ref": "#/$defs/development"}, |
| 933 | + "profiles": { |
| 934 | + "$ref": "#/$defs/list_of_strings", |
| 935 | + "description": "List of profiles for this service. When profiles are specified, services are only started when the profile is activated." |
| 936 | + }, |
| 937 | + "scale": { |
| 938 | + "type": ["integer", "string"], |
| 939 | + "description": "Number of containers to deploy for this service." |
| 940 | + } |
| 941 | + }, |
| 942 | + "unevaluatedProperties": false |
| 943 | + }, |
| 944 | + |
| 945 | + "job": { |
| 946 | + "description": "Configuration for a job. Jobs are containers that run to completion.", |
| 947 | + "allOf": [{"$ref": "#/$defs/container_spec"}], |
| 948 | + "properties": { |
| 949 | + "triggers": { |
| 950 | + "type": "object", |
| 951 | + "description": "Trigger conditions for the job.", |
| 952 | + "properties": { |
| 953 | + "manual": { |
| 954 | + "type": "boolean", |
| 955 | + "description": "Whether the job can be triggered manually via docker compose run." |
| 956 | + }, |
| 957 | + "schedule": { |
| 958 | + "type": "string", |
| 959 | + "description": "Crontab expression to schedule the job (e.g. '0 * * * *' for every hour)." |
| 960 | + } |
| 961 | + }, |
| 962 | + "additionalProperties": false, |
| 963 | + "patternProperties": {"^x-": {}} |
| 964 | + } |
| 965 | + }, |
| 966 | + "unevaluatedProperties": false |
925 | 967 | }, |
926 | 968 |
|
927 | 969 | "healthcheck": { |
|
0 commit comments