Skip to content

Commit 889a897

Browse files
feat: update schema
1 parent 113db88 commit 889a897

File tree

5 files changed

+205
-48
lines changed

5 files changed

+205
-48
lines changed

.changeset/real-mice-wash.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@json-types/compose": minor
3+
---
4+
5+
Update schema

packages/compose/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ import schema from "@json-types/compose/schema.json";
2222

2323
TypeScript types generated automatically every night and published when there are changes.
2424

25-
- Last change: 2025-04-24T01:56:08.810Z
25+
- Last change: 2025-04-29T01:57:11.482Z
2626
- Source URL: https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json

packages/compose/index.d.ts

+142-18
Original file line numberDiff line numberDiff line change
@@ -172,16 +172,6 @@ export type ServiceConfigOrSecret = (
172172
mode?: number | string;
173173
}
174174
)[];
175-
export type EnvFile =
176-
| string
177-
| (
178-
| string
179-
| {
180-
path: string;
181-
format?: string;
182-
required?: boolean | string;
183-
}
184-
)[];
185175
export type LabelFile = string | string[];
186176
export type Gpus =
187177
| "all"
@@ -193,12 +183,32 @@ export type Gpus =
193183
options?: ListOrDict;
194184
[k: string]: unknown;
195185
}[];
186+
/**
187+
* Profiles that this service is a part of. When the profile is started, this service will be started.
188+
*/
189+
export type ListOfStrings1 = string[];
190+
/**
191+
* Secrets the service will have access to
192+
*/
193+
export type ServiceConfigOrSecret1 = (
194+
| string
195+
| {
196+
source?: string;
197+
target?: string;
198+
uid?: string;
199+
gid?: string;
200+
mode?: number | string;
201+
}
202+
)[];
196203
/**
197204
* This interface was referenced by `undefined`'s JSON-Schema definition
198205
* via the `patternProperty` "^[a-zA-Z0-9._-]+$".
199206
*/
200207
export type Network = {
201208
name?: string;
209+
/**
210+
* The driver used for this network
211+
*/
202212
driver?: string;
203213
driver_opts?: {
204214
/**
@@ -246,6 +256,9 @@ export type Network = {
246256
} & Network1;
247257
export type Network1 = {
248258
name?: string;
259+
/**
260+
* The driver used for this network
261+
*/
249262
driver?: string;
250263
driver_opts?: {
251264
/**
@@ -297,6 +310,9 @@ export type Network1 = {
297310
*/
298311
export type Volume = {
299312
name?: string;
313+
/**
314+
* The driver used for this volume
315+
*/
300316
driver?: string;
301317
driver_opts?: {
302318
/**
@@ -318,6 +334,9 @@ export type Volume = {
318334
} & Volume1;
319335
export type Volume1 = {
320336
name?: string;
337+
/**
338+
* The driver used for this volume
339+
*/
321340
driver?: string;
322341
driver_opts?: {
323342
/**
@@ -354,18 +373,33 @@ export interface Compose {
354373
* compose sub-projects to be included.
355374
*/
356375
include?: Include[];
376+
/**
377+
* The services in your project
378+
*/
357379
services?: {
358380
[k: string]: Service;
359381
};
382+
/**
383+
* Networks that are shared among multiple services
384+
*/
360385
networks?: {
361386
[k: string]: Network;
362387
};
388+
/**
389+
* Named volumes that are shared among multiple services
390+
*/
363391
volumes?: {
364392
[k: string]: Volume;
365393
};
394+
/**
395+
* Secrets that are shared among multiple services
396+
*/
366397
secrets?: {
367398
[k: string]: Secret;
368399
};
400+
/**
401+
* Configurations for services in the project
402+
*/
369403
configs?: {
370404
[k: string]: Config;
371405
};
@@ -382,11 +416,28 @@ export interface Service {
382416
build?:
383417
| string
384418
| {
419+
/**
420+
* The context used for building the image
421+
*/
385422
context?: string;
423+
/**
424+
* The Dockerfile used for building the image
425+
*/
386426
dockerfile?: string;
387427
dockerfile_inline?: string;
388428
entitlements?: string[];
389-
args?: ListOrDict;
429+
/**
430+
* Arguments used during the image build process
431+
*/
432+
args?:
433+
| {
434+
/**
435+
* This interface was referenced by `undefined`'s JSON-Schema definition
436+
* via the `patternProperty` ".+".
437+
*/
438+
[k: string]: string | number | boolean | null;
439+
}
440+
| string[];
390441
ssh?: ListOrDict;
391442
labels?: ListOrDict;
392443
cache_from?: string[];
@@ -417,8 +468,14 @@ export interface Service {
417468
cap_drop?: string[];
418469
cgroup?: "host" | "private";
419470
cgroup_parent?: string;
420-
command?: Command;
471+
/**
472+
* The command that will be run in the container
473+
*/
474+
command?: null | string | string[];
421475
configs?: ServiceConfigOrSecret;
476+
/**
477+
* The name that will be given to the container
478+
*/
422479
container_name?: string;
423480
cpu_count?: string | number;
424481
cpu_percent?: string | number;
@@ -434,6 +491,9 @@ export interface Service {
434491
file?: string;
435492
registry?: string;
436493
};
494+
/**
495+
* Other services that this service depends on, which will be started before this one
496+
*/
437497
depends_on?:
438498
| ListOfStrings
439499
| {
@@ -460,10 +520,39 @@ export interface Service {
460520
dns_opt?: string[];
461521
dns_search?: StringOrList;
462522
domainname?: string;
463-
entrypoint?: Command;
464-
env_file?: EnvFile;
523+
/**
524+
* The entrypoint to the application in the container
525+
*/
526+
entrypoint?: null | string | string[];
527+
/**
528+
* Files containing environment variables that will be included
529+
*/
530+
env_file?:
531+
| string
532+
| (
533+
| string
534+
| {
535+
path: string;
536+
format?: string;
537+
required?: boolean | string;
538+
}
539+
)[];
465540
label_file?: LabelFile;
466-
environment?: ListOrDict;
541+
/**
542+
* Environment variables that will be included
543+
*/
544+
environment?:
545+
| {
546+
/**
547+
* This interface was referenced by `undefined`'s JSON-Schema definition
548+
* via the `patternProperty` ".+".
549+
*/
550+
[k: string]: string | number | boolean | null;
551+
}
552+
| string[];
553+
/**
554+
* Ports exposed to the other services but not to the host machine
555+
*/
467556
expose?: (string | number)[];
468557
extends?:
469558
| string
@@ -487,12 +576,29 @@ export interface Service {
487576
group_add?: (string | number)[];
488577
healthcheck?: Healthcheck;
489578
hostname?: string;
579+
/**
580+
* The image that will be pulled for the service. If `build` is specified, the built image will be given this tag.
581+
*/
490582
image?: string;
491583
init?: boolean | string;
492584
ipc?: string;
493585
isolation?: string;
494-
labels?: ListOrDict;
586+
/**
587+
* Labels that will be given to the container
588+
*/
589+
labels?:
590+
| {
591+
/**
592+
* This interface was referenced by `undefined`'s JSON-Schema definition
593+
* via the `patternProperty` ".+".
594+
*/
595+
[k: string]: string | number | boolean | null;
596+
}
597+
| string[];
495598
links?: string[];
599+
/**
600+
* Settings for logging for this service
601+
*/
496602
logging?: {
497603
driver?: string;
498604
options?: {
@@ -509,6 +615,9 @@ export interface Service {
509615
mem_swappiness?: number | string;
510616
memswap_limit?: number | string;
511617
network_mode?: string;
618+
/**
619+
* The service will be included in these networks, allowing it to reach other containers on the same network
620+
*/
512621
networks?:
513622
| ListOfStrings
514623
| {
@@ -539,6 +648,9 @@ export interface Service {
539648
pid?: string | null;
540649
pids_limit?: number | string;
541650
platform?: string;
651+
/**
652+
* Ports that will be exposed to the host
653+
*/
542654
ports?: (
543655
| number
544656
| string
@@ -555,7 +667,7 @@ export interface Service {
555667
post_start?: ServiceHook[];
556668
pre_stop?: ServiceHook[];
557669
privileged?: boolean | string;
558-
profiles?: ListOfStrings;
670+
profiles?: ListOfStrings1;
559671
pull_policy?: string;
560672
pull_refresh_after?: string;
561673
read_only?: boolean | string;
@@ -564,7 +676,7 @@ export interface Service {
564676
scale?: number | string;
565677
security_opt?: string[];
566678
shm_size?: number | string;
567-
secrets?: ServiceConfigOrSecret;
679+
secrets?: ServiceConfigOrSecret1;
568680
sysctls?: ListOrDict;
569681
stdin_open?: boolean | string;
570682
stop_grace_period?: string;
@@ -575,9 +687,15 @@ export interface Service {
575687
tmpfs?: StringOrList;
576688
tty?: boolean | string;
577689
ulimits?: Ulimits;
690+
/**
691+
* The username under which the app in the container will be started
692+
*/
578693
user?: string;
579694
uts?: string;
580695
userns_mode?: string;
696+
/**
697+
* Named volumes and paths on the host mapped to paths in the container
698+
*/
581699
volumes?: (
582700
| string
583701
| {
@@ -607,6 +725,9 @@ export interface Service {
607725
}
608726
)[];
609727
volumes_from?: string[];
728+
/**
729+
* The working directory in which the entrypoint or command will be run
730+
*/
610731
working_dir?: string;
611732
}
612733
export interface ServiceHook {
@@ -636,6 +757,9 @@ export interface BlkioWeight {
636757
path?: string;
637758
weight?: number | string;
638759
}
760+
/**
761+
* A command for checking if the container is healthy
762+
*/
639763
export interface Healthcheck {
640764
disable?: boolean | string;
641765
interval?: string;

packages/compose/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"compose-spec"
1515
],
1616
"x-json-types": {
17-
"lastChangeDate": "2025-04-24T01:56:08.810Z"
17+
"lastChangeDate": "2025-04-29T01:57:11.482Z"
1818
},
1919
"homepage": "https://github.com/swordev/json-types/tree/main/packages/compose",
2020
"bugs": {

0 commit comments

Comments
 (0)