stop minio proxy on restart
This commit is contained in:
parent
1ece37ec3c
commit
60e7922734
@ -389,17 +389,17 @@ async function checkProxies() {
|
||||
}
|
||||
|
||||
// HTTP Proxies
|
||||
// const minioInstances = await prisma.minio.findMany({
|
||||
// where: { publicPort: { not: null } },
|
||||
// include: { service: { include: { destinationDocker: true } } }
|
||||
// });
|
||||
// for (const minio of minioInstances) {
|
||||
// const { service, publicPort } = minio;
|
||||
// const { destinationDockerId, destinationDocker, id } = service;
|
||||
// if (destinationDockerId && destinationDocker.isCoolifyProxyUsed) {
|
||||
// await startTraefikTCPProxy(destinationDocker, id, publicPort, 9000);
|
||||
// }
|
||||
// }
|
||||
const minioInstances = await prisma.minio.findMany({
|
||||
where: { publicPort: { not: null } },
|
||||
include: { service: { include: { destinationDocker: true } } }
|
||||
});
|
||||
for (const minio of minioInstances) {
|
||||
const { service, publicPort } = minio;
|
||||
const { destinationDockerId, destinationDocker, id } = service;
|
||||
if (destinationDockerId && destinationDocker.isCoolifyProxyUsed) {
|
||||
await startTraefikTCPProxy(destinationDocker, id, publicPort, 9000);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
@ -356,7 +356,6 @@ async function vscodeserver(service: any, template: any) {
|
||||
}
|
||||
async function minio(service: any, template: any) {
|
||||
const { rootUser, rootUserPassword, apiFqdn } = service.minio
|
||||
console.log(apiFqdn)
|
||||
const secrets = [
|
||||
`MINIO_ROOT_PASSWORD@@@${rootUserPassword}`,
|
||||
]
|
||||
@ -432,7 +431,6 @@ async function plausibleAnalytics(service: any, template: any) {
|
||||
async function migrateSettings(settings: any[], service: any, template: any) {
|
||||
for (const setting of settings) {
|
||||
if (!setting) continue;
|
||||
console.log(setting)
|
||||
let [name, value] = setting.split('@@@')
|
||||
let minio = name
|
||||
if (name === 'MINIO_SERVER_URL') {
|
||||
|
@ -2,7 +2,7 @@ import type { FastifyReply, FastifyRequest } from 'fastify';
|
||||
import fs from 'fs/promises';
|
||||
import yaml from 'js-yaml';
|
||||
import path from 'path';
|
||||
import { asyncSleep, ComposeFile, createDirectories, decrypt, defaultComposeConfiguration, errorHandler, executeDockerCmd, getServiceFromDB, isARM, makeLabelForServices, persistentVolumes, prisma } from '../common';
|
||||
import { asyncSleep, ComposeFile, createDirectories, decrypt, defaultComposeConfiguration, errorHandler, executeDockerCmd, getServiceFromDB, isARM, makeLabelForServices, persistentVolumes, prisma, stopTcpHttpProxy } from '../common';
|
||||
import { parseAndFindServiceTemplates } from '../../routes/api/v1/services/handlers';
|
||||
|
||||
import { ServiceStartStop } from '../../routes/api/v1/services/types';
|
||||
@ -139,6 +139,9 @@ export async function startService(request: FastifyRequest<ServiceStartStop>, fa
|
||||
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
||||
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
||||
await startServiceContainers(fastify, id, teamId, destinationDocker.id, composeFileDestination)
|
||||
if (service.type === 'minio') {
|
||||
await stopTcpHttpProxy(id, destinationDocker, 9000);
|
||||
}
|
||||
return {}
|
||||
} catch ({ status, message }) {
|
||||
return errorHandler({ status, message })
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user