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
fixes
Andras Bacsai224604f2e74a
diff --git a/Dockerfile b/Dockerfileindex fea6b8624e..50f6162911 100644--- a/Dockerfile+++ b/Dockerfile@@ -21,7 +21,7 @@ ENV PRISMA_QUERY_ENGINE_BINARY=/app/prisma-engines/query-engine \PRISMA_CLI_QUERY_ENGINE_TYPE=binary \PRISMA_CLIENT_ENGINE_TYPE=binary-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 /app/prisma-engines/RUN apk add --no-cache git git-lfs openssh-client curl jq cmake sqlite openssl psmiscRUN curl -sL https://unpkg.com/@pnpm/self-installer | nodediff --git a/apps/api/src/index.ts b/apps/api/src/index.tsindex 1230b92bc8..dac8d34ef6 100644--- a/apps/api/src/index.ts+++ b/apps/api/src/index.ts@@ -103,8 +103,7 @@ fastify.listen({ port, host }, async (err: any, address: any) => {}console.log(`Coolify's API is listening on ${host}:${port}`);await initServer();- // await scheduler.start('cleanupPrismaEngines');- // await scheduler.start('checkProxies');+const graceful = new Graceful({ brees: [scheduler] });graceful.listen();@@ -133,9 +132,9 @@ fastify.listen({ port, host }, async (err: any, address: any) => {}, 10000)// cleanupPrismaEngines- setInterval(async () => {- scheduler.workers.has('infrastructure') && scheduler.workers.get('infrastructure').postMessage("action:cleanupPrismaEngines")- }, 60000)+ // setInterval(async () => {+ // scheduler.workers.has('infrastructure') && scheduler.workers.get('infrastructure').postMessage("action:cleanupPrismaEngines")+ // }, 60000)await getArch();await getIPAddress();diff --git a/apps/api/src/jobs/infrastructure.ts b/apps/api/src/jobs/infrastructure.tsindex 52a5667589..740d011d23 100644--- a/apps/api/src/jobs/infrastructure.ts+++ b/apps/api/src/jobs/infrastructure.ts@@ -39,7 +39,7 @@ async function autoUpdater() {console.log(error);}}-async function checkProxies(){+async function checkProxies() {try {const { default: isReachable } = await import('is-port-reachable');let portReachable;@@ -50,7 +50,7 @@ async function checkProxies(){const localDocker = await prisma.destinationDocker.findFirst({where: { engine, network: 'coolify' }});- if (localDocker && localDocker.isCoolifyProxyUsed) {+ if (localDocker && localDocker.isCoolifyProxyUsed) {portReachable = await isReachable(80, { host: ipv4 || ipv6 })console.log({ port: 80, portReachable });if (!portReachable) {@@ -106,16 +106,16 @@ async function checkProxies(){}}}- } catch(error) {+ } catch (error) {}}-async function cleanupPrismaEngines(){+async function cleanupPrismaEngines() {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`)+ await asyncExecShell(`killall -q -e /app/prisma-engines/query-engine -o 1m`)}} catch (error) {console.log(error);@@ -178,7 +178,7 @@ async function cleanupStorage() {}(async () => {- let status ={+ let status = {cleanupStorage: false,autoUpdater: false}diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.tsindex cceca5ba71..e3326c4a9f 100644--- a/apps/api/src/lib/common.ts+++ b/apps/api/src/lib/common.ts@@ -155,11 +155,11 @@ export const prisma = new PrismaClient({],});-// prisma.$on('query', (e) => {-// console.log('Query: ' + e.query)-// console.log('Params: ' + e.params)-// console.log('Duration: ' + e.duration + 'ms')-// })+prisma.$on('query', (e) => {+ console.log('Query: ' + e.query)+ console.log('Params: ' + e.params)+ console.log('Duration: ' + e.duration + 'ms')+ })export const base64Encode = (text: string): string => {return Buffer.from(text).toString('base64');};diff --git a/apps/api/src/lib/scheduler.ts b/apps/api/src/lib/scheduler.tsindex 71f5bc6f09..2e7db85cbc 100644--- a/apps/api/src/lib/scheduler.ts+++ b/apps/api/src/lib/scheduler.ts@@ -20,20 +20,6 @@ const options: any = {jobs: [{ name: 'infrastructure' },{ name: 'deployApplication' },- // {- // name: 'cleanupStorage',- // },- // {- // name: 'cleanupPrismaEngines',- // interval: '1m'- // },- // {- // name: 'checkProxies',- // interval: '10s'- // },- // {- // name: 'autoUpdater',- // }],};if (isDev) options.root = path.join(__dirname, '../jobs');