commit
272b2bb65d
@ -23,7 +23,7 @@ ENV PRISMA_QUERY_ENGINE_BINARY=/app/prisma-engines/query-engine \
|
|||||||
|
|
||||||
COPY --from=coollabsio/prisma-engine:3.15 /prisma-engines/query-engine /prisma-engines/migration-engine /prisma-engines/introspection-engine /prisma-engines/prisma-fmt /app/prisma-engines/
|
COPY --from=coollabsio/prisma-engine:3.15 /prisma-engines/query-engine /prisma-engines/migration-engine /prisma-engines/introspection-engine /prisma-engines/prisma-fmt /app/prisma-engines/
|
||||||
|
|
||||||
RUN apk add --no-cache git git-lfs openssh-client curl jq cmake sqlite openssl
|
RUN apk add --no-cache git git-lfs openssh-client curl jq cmake sqlite openssl psmisc
|
||||||
RUN curl -sL https://unpkg.com/@pnpm/self-installer | node
|
RUN curl -sL https://unpkg.com/@pnpm/self-installer | node
|
||||||
|
|
||||||
RUN mkdir -p ~/.docker/cli-plugins/
|
RUN mkdir -p ~/.docker/cli-plugins/
|
||||||
|
@ -104,6 +104,7 @@ fastify.listen({ port, host }, async (err: any, address: any) => {
|
|||||||
await initServer();
|
await initServer();
|
||||||
await scheduler.start('deployApplication');
|
await scheduler.start('deployApplication');
|
||||||
await scheduler.start('cleanupStorage');
|
await scheduler.start('cleanupStorage');
|
||||||
|
await scheduler.start('cleanupPrismaEngines');
|
||||||
await scheduler.start('checkProxies');
|
await scheduler.start('checkProxies');
|
||||||
|
|
||||||
// Check if no build is running
|
// Check if no build is running
|
||||||
@ -116,14 +117,14 @@ fastify.listen({ port, host }, async (err: any, address: any) => {
|
|||||||
scheduler.workers.get('deployApplication').postMessage("status:autoUpdater");
|
scheduler.workers.get('deployApplication').postMessage("status:autoUpdater");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 60000 * 15)
|
}, isDev ? 5000 : 60000 * 15)
|
||||||
|
|
||||||
// Cleanup storage
|
// Cleanup storage
|
||||||
setInterval(async () => {
|
setInterval(async () => {
|
||||||
if (scheduler.workers.has('deployApplication')) {
|
if (scheduler.workers.has('deployApplication')) {
|
||||||
scheduler.workers.get('deployApplication').postMessage("status:cleanupStorage");
|
scheduler.workers.get('deployApplication').postMessage("status:cleanupStorage");
|
||||||
}
|
}
|
||||||
}, 60000 * 10)
|
}, isDev ? 5000 : 60000 * 10)
|
||||||
|
|
||||||
scheduler.on('worker deleted', async (name) => {
|
scheduler.on('worker deleted', async (name) => {
|
||||||
if (name === 'autoUpdater' || name === 'cleanupStorage') {
|
if (name === 'autoUpdater' || name === 'cleanupStorage') {
|
||||||
|
@ -4,6 +4,7 @@ import { checkContainer } from '../lib/docker';
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
if (parentPort) {
|
if (parentPort) {
|
||||||
|
try {
|
||||||
// Coolify Proxy local
|
// Coolify Proxy local
|
||||||
const engine = '/var/run/docker.sock';
|
const engine = '/var/run/docker.sock';
|
||||||
const localDocker = await prisma.destinationDocker.findFirst({
|
const localDocker = await prisma.destinationDocker.findFirst({
|
||||||
@ -19,7 +20,6 @@ import { checkContainer } from '../lib/docker';
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
await startTraefikProxy(localDocker.id);
|
await startTraefikProxy(localDocker.id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TCP Proxies
|
// TCP Proxies
|
||||||
@ -42,7 +42,6 @@ import { checkContainer } from '../lib/docker';
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
await startTraefikTCPProxy(destinationDocker, id, publicPort, privatePort);
|
await startTraefikTCPProxy(destinationDocker, id, publicPort, privatePort);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const wordpressWithFtp = await prisma.wordpress.findMany({
|
const wordpressWithFtp = await prisma.wordpress.findMany({
|
||||||
@ -85,6 +84,12 @@ import { checkContainer } from '../lib/docker';
|
|||||||
await startTraefikTCPProxy(destinationDocker, id, publicPort, 9000);
|
await startTraefikTCPProxy(destinationDocker, id, publicPort, 9000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
} finally {
|
||||||
await prisma.$disconnect();
|
await prisma.$disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
} else process.exit(0);
|
} else process.exit(0);
|
||||||
})();
|
})();
|
||||||
|
19
apps/api/src/jobs/cleanupPrismaEngines.ts
Normal file
19
apps/api/src/jobs/cleanupPrismaEngines.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { parentPort } from 'node:worker_threads';
|
||||||
|
import { asyncExecShell, isDev, prisma } from '../lib/common';
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
if (parentPort) {
|
||||||
|
if (!isDev) {
|
||||||
|
try {
|
||||||
|
const { stdout } = await asyncExecShell(`ps -ef | grep /app/prisma-engines/query-engine | grep -v grep | wc -l | xargs`)
|
||||||
|
if (stdout.trim() != null && stdout.trim() != '' && Number(stdout.trim()) > 1) {
|
||||||
|
await asyncExecShell(`killall -q -e /app/prisma-engines/query-engine -o 10m`)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
} finally {
|
||||||
|
await prisma.$disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else process.exit(0);
|
||||||
|
})();
|
@ -192,9 +192,9 @@ import * as buildpacks from '../lib/buildPacks';
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
await copyBaseConfigurationFiles(buildPack, workdir, buildId, applicationId, baseImage);
|
||||||
if (!imageFound || deployNeeded) {
|
if (!imageFound || deployNeeded) {
|
||||||
// if (true) {
|
// if (true) {
|
||||||
await copyBaseConfigurationFiles(buildPack, workdir, buildId, applicationId, baseImage);
|
|
||||||
if (buildpacks[buildPack])
|
if (buildpacks[buildPack])
|
||||||
await buildpacks[buildPack]({
|
await buildpacks[buildPack]({
|
||||||
dockerId: destinationDocker.id,
|
dockerId: destinationDocker.id,
|
||||||
@ -248,11 +248,11 @@ import * as buildpacks from '../lib/buildPacks';
|
|||||||
secrets.forEach((secret) => {
|
secrets.forEach((secret) => {
|
||||||
if (pullmergeRequestId) {
|
if (pullmergeRequestId) {
|
||||||
if (secret.isPRMRSecret) {
|
if (secret.isPRMRSecret) {
|
||||||
envs.push(`${secret.name}=${secret.value}`);
|
envs.push(`${secret.name}='${secret.value}'`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!secret.isPRMRSecret) {
|
if (!secret.isPRMRSecret) {
|
||||||
envs.push(`${secret.name}=${secret.value}`);
|
envs.push(`${secret.name}='${secret.value}'`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -523,7 +523,7 @@ export async function buildImage({
|
|||||||
await saveBuildLog({ line: `Building image started.`, buildId, applicationId });
|
await saveBuildLog({ line: `Building image started.`, buildId, applicationId });
|
||||||
}
|
}
|
||||||
if (debug) {
|
if (debug) {
|
||||||
await saveBuildLog({ line: `\n###############\nIMPORTANT: Due to some issues during implementing Remote Docker Engine, the builds logs are not streamed at the moment. You will see the full build log when the build is finished!\n###############`, buildId, applicationId });
|
await saveBuildLog({ line: `\n###############\nIMPORTANT: Due to some issues during implementing Remote Docker Engine, the builds logs are not streamed at the moment - but will be soon! You will see the full build log when the build is finished!\n###############`, buildId, applicationId });
|
||||||
}
|
}
|
||||||
if (!debug && isCache) {
|
if (!debug && isCache) {
|
||||||
await saveBuildLog({
|
await saveBuildLog({
|
||||||
|
@ -17,7 +17,7 @@ import { checkContainer, removeContainer } from './docker';
|
|||||||
import { day } from './dayjs';
|
import { day } from './dayjs';
|
||||||
import * as serviceFields from './serviceFields'
|
import * as serviceFields from './serviceFields'
|
||||||
|
|
||||||
export const version = '3.2.2';
|
export const version = '3.2.3';
|
||||||
export const isDev = process.env.NODE_ENV === 'development';
|
export const isDev = process.env.NODE_ENV === 'development';
|
||||||
|
|
||||||
const algorithm = 'aes-256-ctr';
|
const algorithm = 'aes-256-ctr';
|
||||||
@ -39,7 +39,7 @@ export function getAPIUrl() {
|
|||||||
return newURL
|
return newURL
|
||||||
}
|
}
|
||||||
if (process.env.CODESANDBOX_HOST) {
|
if (process.env.CODESANDBOX_HOST) {
|
||||||
return `https://${process.env.CODESANDBOX_HOST.replace(/\$PORT/,'3001')}`
|
return `https://${process.env.CODESANDBOX_HOST.replace(/\$PORT/, '3001')}`
|
||||||
}
|
}
|
||||||
return isDev ? 'http://localhost:3001' : 'http://localhost:3000';
|
return isDev ? 'http://localhost:3001' : 'http://localhost:3000';
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ export function getUIUrl() {
|
|||||||
return newURL
|
return newURL
|
||||||
}
|
}
|
||||||
if (process.env.CODESANDBOX_HOST) {
|
if (process.env.CODESANDBOX_HOST) {
|
||||||
return `https://${process.env.CODESANDBOX_HOST.replace(/\$PORT/,'3000')}`
|
return `https://${process.env.CODESANDBOX_HOST.replace(/\$PORT/, '3000')}`
|
||||||
}
|
}
|
||||||
return 'http://localhost:3000';
|
return 'http://localhost:3000';
|
||||||
}
|
}
|
||||||
@ -1637,7 +1637,7 @@ export function persistentVolumes(id, persistentStorage, config) {
|
|||||||
return `${id}${storage.path.replace(/\//gi, '-')}:${storage.path}`;
|
return `${id}${storage.path.replace(/\//gi, '-')}:${storage.path}`;
|
||||||
}) || [];
|
}) || [];
|
||||||
|
|
||||||
let volumes = [ ...persistentVolume]
|
let volumes = [...persistentVolume]
|
||||||
if (config.volume) volumes = [config.volume, ...volumes]
|
if (config.volume) volumes = [config.volume, ...volumes]
|
||||||
|
|
||||||
const composeVolumes = volumes.length > 0 && volumes.map((volume) => {
|
const composeVolumes = volumes.length > 0 && volumes.map((volume) => {
|
||||||
|
@ -35,6 +35,10 @@ const options: any = {
|
|||||||
{
|
{
|
||||||
name: 'cleanupStorage',
|
name: 'cleanupStorage',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'cleanupPrismaEngines',
|
||||||
|
interval: '1m'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'checkProxies',
|
name: 'checkProxies',
|
||||||
interval: '10s'
|
interval: '10s'
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
async function createSecret(isNew: any) {
|
async function createSecret(isNew: any) {
|
||||||
try {
|
try {
|
||||||
if (!name || !value) return
|
if (!name || !value) return;
|
||||||
await saveSecret({
|
await saveSecret({
|
||||||
isNew,
|
isNew,
|
||||||
name,
|
name,
|
||||||
@ -53,12 +53,16 @@
|
|||||||
name = '';
|
name = '';
|
||||||
value = '';
|
value = '';
|
||||||
isBuildSecret = false;
|
isBuildSecret = false;
|
||||||
}
|
|
||||||
dispatch('refresh');
|
|
||||||
addToast({
|
addToast({
|
||||||
message: 'Secret removed.',
|
message: 'Secret added.',
|
||||||
type: 'success'
|
type: 'success'
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
addToast({
|
||||||
|
message: 'Secret updated.',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
dispatch('refresh');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
return errorNotification(error);
|
return errorNotification(error);
|
||||||
@ -79,7 +83,7 @@
|
|||||||
applicationId: id
|
applicationId: id
|
||||||
});
|
});
|
||||||
addToast({
|
addToast({
|
||||||
message: 'Secret removed.',
|
message: 'Secret updated.',
|
||||||
type: 'success'
|
type: 'success'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "coolify",
|
"name": "coolify",
|
||||||
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
|
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
|
||||||
"version": "3.2.2",
|
"version": "3.2.3",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": "github:coollabsio/coolify",
|
"repository": "github:coollabsio/coolify",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user