Implemented typing for dockerfile configuration
This commit is contained in:
49
src/lib/types/composeFile.ts
Normal file
49
src/lib/types/composeFile.ts
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user