This commit is contained in:
Andras Bacsai
2022-10-20 16:06:33 +02:00
parent 9f3732d35b
commit f4019db3d1
9 changed files with 191 additions and 65 deletions

View File

@@ -1,5 +1,13 @@
import { createDirectories, getServiceFromDB, getServiceImage, getServiceMainPort, makeLabelForServices } from "./common";
import { createDirectories, getServiceFromDB, getServiceImage, getServiceMainPort, isDev, makeLabelForServices } from "./common";
import fs from 'fs/promises';
export async function getTemplates() {
let templates = [];
if (isDev) {
templates = JSON.parse((await fs.readFile('./template.json')).toString())
}
return templates
}
export async function defaultServiceConfigurations({ id, teamId }) {
const service = await getServiceFromDB({ id, teamId });
const { destinationDockerId, destinationDocker, type, serviceSecret } = service;

View File

@@ -6,7 +6,7 @@ import { ServiceStartStop } from '../../routes/api/v1/services/types';
import { asyncSleep, ComposeFile, createDirectories, defaultComposeConfiguration, errorHandler, executeDockerCmd, getDomain, getFreePublicPort, getServiceFromDB, getServiceImage, getServiceMainPort, isARM, isDev, makeLabelForServices, persistentVolumes, prisma } from '../common';
import { defaultServiceConfigurations } from '../services';
import { OnlyId } from '../../types';
import templates from '../templates'
import { parseAndFindServiceTemplates } from '../../routes/api/v1/services/handlers';
import path from 'path';
// export async function startService(request: FastifyRequest<ServiceStartStop>) {
@@ -711,6 +711,7 @@ export async function startService(request: FastifyRequest<ServiceStartStop>) {
container_name: service,
build: template.services[service].build || undefined,
command: template.services[service].command,
entrypoint: template.services[service]?.entrypoint,
image: template.services[service].image,
expose: template.services[service].ports,
// ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),

View File

@@ -21,7 +21,7 @@ export default [
`WEBLATE_ADMIN_PASSWORD=$$secret_weblate_admin_password`,
`POSTGRES_PASSWORD=$$secret_postgres_password`,
`POSTGRES_USER=$$config_postgres_user`,
`POSTGRES_DATABASE=$$config_postgres_database`,
`POSTGRES_DATABASE=$$config_postgres_db`,
`POSTGRES_HOST=$$id-postgresql`,
`POSTGRES_PORT=5432`,
`REDIS_HOST=$$id-redis`,
@@ -94,13 +94,7 @@ export default [
"defaultValue": "weblate",
"description": "",
},
{
"id": "$$config_postgres_database",
"name": "POSTGRES_DATABASE",
"label": "PostgreSQL Database",
"defaultValue": "$$config_postgres_db",
"description": ""
},
]
},
{
@@ -121,7 +115,6 @@ export default [
],
"environment": [
"SEARXNG_BASE_URL=$$config_searxng_base_url",
"SECRET_KEY=$$secret_secret_key",
],
"ports": [
"8080"
@@ -1462,9 +1455,7 @@ export default [
"label": "Secret Key Base",
"defaultValue": "$$generate_passphrase",
"description": "",
"extras": {
"length": 64
}
},
{
"id": "$$config_disable_auth",