An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
Implemented typing for dockerfile configuration
dominicbachmannf1313b646837
diff --git a/src/lib/types/composeFile.ts b/src/lib/types/composeFile.tsnew file mode 100644index 0000000000..b7e88210f3--- /dev/null+++ b/src/lib/types/composeFile.ts@@ -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;+};diff --git a/src/routes/databases/[id]/start.json.ts b/src/routes/databases/[id]/start.json.tsindex bca2995d49..59fd7c1ea3 100644--- a/src/routes/databases/[id]/start.json.ts+++ b/src/routes/databases/[id]/start.json.ts@@ -6,6 +6,7 @@ import yaml from 'js-yaml';import type { RequestHandler } from '@sveltejs/kit';import { makeLabelForStandaloneDatabase } from '$lib/buildPacks/common';import { startTcpProxy } from '$lib/haproxy';+import type { ComposeFile } from '$lib/types/composeFile';export const post: RequestHandler = async (event) => {const { teamId, status, body } = await getUserDetails(event);@@ -33,7 +34,7 @@ export const post: RequestHandler = async (event) => {const { workdir } = await createDirectories({ repository: type, buildId: id });- const composeFile = {+ const composeFile: ComposeFile = {version: '3.8',services: {[id]: {diff --git a/src/routes/services/[id]/ghost/start.json.ts b/src/routes/services/[id]/ghost/start.json.tsindex 4fd9e7fa43..9e0b4ba11d 100644--- a/src/routes/services/[id]/ghost/start.json.ts+++ b/src/routes/services/[id]/ghost/start.json.ts@@ -11,6 +11,7 @@ import yaml from 'js-yaml';import type { RequestHandler } from '@sveltejs/kit';import { ErrorHandler, getServiceImage } from '$lib/database';import { makeLabelForServices } from '$lib/buildPacks/common';+import type { ComposeFile } from '$lib/types/composeFile';export const post: RequestHandler = async (event) => {const { teamId, status, body } = await getUserDetails(event);@@ -75,7 +76,7 @@ export const post: RequestHandler = async (event) => {config.ghost.environmentVariables[secret.name] = secret.value;});}- const composeFile = {+ const composeFile: ComposeFile = {version: '3.8',services: {[id]: {diff --git a/src/routes/services/[id]/languagetool/start.json.ts b/src/routes/services/[id]/languagetool/start.json.tsindex a6a81d4756..ac0f6a5bb6 100644--- a/src/routes/services/[id]/languagetool/start.json.ts+++ b/src/routes/services/[id]/languagetool/start.json.ts@@ -5,6 +5,7 @@ import yaml from 'js-yaml';import type { RequestHandler } from '@sveltejs/kit';import { ErrorHandler, getServiceImage } from '$lib/database';import { makeLabelForServices } from '$lib/buildPacks/common';+import type { ComposeFile } from '$lib/types/composeFile';export const post: RequestHandler = async (event) => {const { teamId, status, body } = await getUserDetails(event);@@ -32,7 +33,7 @@ export const post: RequestHandler = async (event) => {config.environmentVariables[secret.name] = secret.value;});}- const composeFile = {+ const composeFile: ComposeFile = {version: '3.8',services: {[id]: {diff --git a/src/routes/services/[id]/meilisearch/start.json.ts b/src/routes/services/[id]/meilisearch/start.json.tsindex 646a8b1ba2..5a5a9d5c09 100644--- a/src/routes/services/[id]/meilisearch/start.json.ts+++ b/src/routes/services/[id]/meilisearch/start.json.ts@@ -5,6 +5,7 @@ import yaml from 'js-yaml';import type { RequestHandler } from '@sveltejs/kit';import { ErrorHandler, getServiceImage } from '$lib/database';import { makeLabelForServices } from '$lib/buildPacks/common';+import type { ComposeFile } from '$lib/types/composeFile';export const post: RequestHandler = async (event) => {const { teamId, status, body } = await getUserDetails(event);@@ -37,7 +38,7 @@ export const post: RequestHandler = async (event) => {config.environmentVariables[secret.name] = secret.value;});}- const composeFile = {+ const composeFile: ComposeFile = {version: '3.8',services: {[id]: {diff --git a/src/routes/services/[id]/minio/start.json.ts b/src/routes/services/[id]/minio/start.json.tsindex bcffd9e8f5..6e14a42ca3 100644--- a/src/routes/services/[id]/minio/start.json.ts+++ b/src/routes/services/[id]/minio/start.json.ts@@ -8,6 +8,7 @@ import getPort, { portNumbers } from 'get-port';import { getDomain } from '$lib/components/common';import { ErrorHandler, getServiceImage } from '$lib/database';import { makeLabelForServices } from '$lib/buildPacks/common';+import type { ComposeFile } from '$lib/types/composeFile';export const post: RequestHandler = async (event) => {const { teamId, status, body } = await getUserDetails(event);@@ -55,7 +56,7 @@ export const post: RequestHandler = async (event) => {config.environmentVariables[secret.name] = secret.value;});}- const composeFile = {+ const composeFile: ComposeFile = {version: '3.8',services: {[id]: {diff --git a/src/routes/services/[id]/n8n/start.json.ts b/src/routes/services/[id]/n8n/start.json.tsindex e5ad7e9304..3df1855d06 100644--- a/src/routes/services/[id]/n8n/start.json.ts+++ b/src/routes/services/[id]/n8n/start.json.ts@@ -5,6 +5,7 @@ import yaml from 'js-yaml';import type { RequestHandler } from '@sveltejs/kit';import { ErrorHandler, getServiceImage } from '$lib/database';import { makeLabelForServices } from '$lib/buildPacks/common';+import type { ComposeFile } from '$lib/types/composeFile';export const post: RequestHandler = async (event) => {const { teamId, status, body } = await getUserDetails(event);@@ -33,7 +34,7 @@ export const post: RequestHandler = async (event) => {config.environmentVariables[secret.name] = secret.value;});}- const composeFile = {+ const composeFile: ComposeFile = {version: '3.8',services: {[id]: {diff --git a/src/routes/services/[id]/nocodb/start.json.ts b/src/routes/services/[id]/nocodb/start.json.tsindex ebc59ce97b..1642038b3b 100644--- a/src/routes/services/[id]/nocodb/start.json.ts+++ b/src/routes/services/[id]/nocodb/start.json.ts@@ -5,6 +5,7 @@ import yaml from 'js-yaml';import type { RequestHandler } from '@sveltejs/kit';import { ErrorHandler, getServiceImage } from '$lib/database';import { makeLabelForServices } from '$lib/buildPacks/common';+import type { ComposeFile } from '$lib/types/composeFile';export const post: RequestHandler = async (event) => {const { teamId, status, body } = await getUserDetails(event);@@ -30,7 +31,7 @@ export const post: RequestHandler = async (event) => {config.environmentVariables[secret.name] = secret.value;});}- const composeFile = {+ const composeFile: ComposeFile = {version: '3.8',services: {[id]: {diff --git a/src/routes/services/[id]/plausibleanalytics/start.json.ts b/src/routes/services/[id]/plausibleanalytics/start.json.tsindex 836bd0178f..6ca37c5e87 100644--- a/src/routes/services/[id]/plausibleanalytics/start.json.ts+++ b/src/routes/services/[id]/plausibleanalytics/start.json.ts@@ -5,6 +5,7 @@ import yaml from 'js-yaml';import type { RequestHandler } from '@sveltejs/kit';import { ErrorHandler, getServiceImage } from '$lib/database';import { makeLabelForServices } from '$lib/buildPacks/common';+import type { ComposeFile } from '$lib/types/composeFile';export const post: RequestHandler = async (event) => {const { teamId, status, body } = await getUserDetails(event);@@ -120,7 +121,7 @@ COPY ./init.query /docker-entrypoint-initdb.d/init.queryCOPY ./init-db.sh /docker-entrypoint-initdb.d/init-db.sh`;await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile);- const composeFile = {+ const composeFile: ComposeFile = {version: '3.8',services: {[id]: {diff --git a/src/routes/services/[id]/uptimekuma/start.json.ts b/src/routes/services/[id]/uptimekuma/start.json.tsindex 845873bb0e..7a72326e15 100644--- a/src/routes/services/[id]/uptimekuma/start.json.ts+++ b/src/routes/services/[id]/uptimekuma/start.json.ts@@ -5,6 +5,7 @@ import yaml from 'js-yaml';import type { RequestHandler } from '@sveltejs/kit';import { ErrorHandler, getServiceImage } from '$lib/database';import { makeLabelForServices } from '$lib/buildPacks/common';+import type { ComposeFile } from '$lib/types/composeFile';export const post: RequestHandler = async (event) => {const { teamId, status, body } = await getUserDetails(event);@@ -31,7 +32,7 @@ export const post: RequestHandler = async (event) => {config.environmentVariables[secret.name] = secret.value;});}- const composeFile = {+ const composeFile: ComposeFile = {version: '3.8',services: {[id]: {diff --git a/src/routes/services/[id]/vaultwarden/start.json.ts b/src/routes/services/[id]/vaultwarden/start.json.tsindex f977adda3a..ae13d90154 100644--- a/src/routes/services/[id]/vaultwarden/start.json.ts+++ b/src/routes/services/[id]/vaultwarden/start.json.ts@@ -5,6 +5,7 @@ import yaml from 'js-yaml';import type { RequestHandler } from '@sveltejs/kit';import { getServiceImage, ErrorHandler } from '$lib/database';import { makeLabelForServices } from '$lib/buildPacks/common';+import type { ComposeFile } from '$lib/types/composeFile';export const post: RequestHandler = async (event) => {const { teamId, status, body } = await getUserDetails(event);@@ -32,7 +33,7 @@ export const post: RequestHandler = async (event) => {config.environmentVariables[secret.name] = secret.value;});}- const composeFile = {+ const composeFile: ComposeFile = {version: '3.8',services: {[id]: {diff --git a/src/routes/services/[id]/vscodeserver/start.json.ts b/src/routes/services/[id]/vscodeserver/start.json.tsindex 6f51fcf2a4..dbe0c120ce 100644--- a/src/routes/services/[id]/vscodeserver/start.json.ts+++ b/src/routes/services/[id]/vscodeserver/start.json.ts@@ -5,6 +5,7 @@ import yaml from 'js-yaml';import type { RequestHandler } from '@sveltejs/kit';import { ErrorHandler, getServiceImage } from '$lib/database';import { makeLabelForServices } from '$lib/buildPacks/common';+import type { ComposeFile } from '$lib/types/composeFile';export const post: RequestHandler = async (event) => {const { teamId, status, body } = await getUserDetails(event);@@ -41,7 +42,7 @@ export const post: RequestHandler = async (event) => {config.environmentVariables[secret.name] = secret.value;});}- const composeFile = {+ const composeFile: ComposeFile = {version: '3.8',services: {[id]: {diff --git a/src/routes/services/[id]/wordpress/start.json.ts b/src/routes/services/[id]/wordpress/start.json.tsindex 98e7d6aab5..c0a28e0bd4 100644--- a/src/routes/services/[id]/wordpress/start.json.ts+++ b/src/routes/services/[id]/wordpress/start.json.ts@@ -5,6 +5,7 @@ import yaml from 'js-yaml';import type { RequestHandler } from '@sveltejs/kit';import { ErrorHandler, getServiceImage } from '$lib/database';import { makeLabelForServices } from '$lib/buildPacks/common';+import type { ComposeFile } from '$lib/types/composeFile';export const post: RequestHandler = async (event) => {const { teamId, status, body } = await getUserDetails(event);@@ -65,7 +66,7 @@ export const post: RequestHandler = async (event) => {config.wordpress.environmentVariables[secret.name] = secret.value;});}- const composeFile = {+ const composeFile: ComposeFile = {version: '3.8',services: {[id]: {