Implemented typing for dockerfile configuration

This commit is contained in:
dominicbachmann
2022-04-05 01:13:25 +02:00
parent 3ef093c7e6
commit f1313b6468
13 changed files with 73 additions and 12 deletions

View File

@@ -0,0 +1,49 @@
import { makeLabelForServices } from '../buildPacks/common';
export type ComposeFile = {
version: ComposerFileVersion;
services: Record<string, ComposeFileService>;
networks: Record<string, ComposeFileNetwork>;
volumes?: Record<string, ComposeFileVolume>;
};
export type ComposeFileService = {
container_name: string;
image?: string;
networks: string[];
environment: Record<string, unknown>;
volumes?: string[];
ulimits?: unknown;
labels?: string[];
restart: ComposeFileRestartOption;
depends_on?: string[];
command?: string;
build?: string;
};
export type ComposerFileVersion =
| '3.8'
| '3.7'
| '3.6'
| '3.5'
| '3.4'
| '3.3'
| '3.2'
| '3.1'
| '3.0'
| '2.4'
| '2.3'
| '2.2'
| '2.1'
| '2.0';
export type ComposeFileRestartOption = 'no' | 'always' | 'on-failure' | 'unless-stopped';
export type ComposeFileNetwork = {
external: boolean;
};
export type ComposeFileVolume = {
external?: boolean;
name?: string;
};