mirror of
https://github.com/ershisan99/coolify.git
synced 2025-12-17 04:59:30 +00:00
fix: docker compose env file
This commit is contained in:
@@ -381,7 +381,6 @@ main()
|
|||||||
reEncryptSecrets()
|
reEncryptSecrets()
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
process.exit(1);
|
|
||||||
})
|
})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
await prisma.$disconnect();
|
await prisma.$disconnect();
|
||||||
|
|||||||
@@ -19,7 +19,9 @@ export default async function (data) {
|
|||||||
dockerComposeConfiguration,
|
dockerComposeConfiguration,
|
||||||
dockerComposeFileLocation
|
dockerComposeFileLocation
|
||||||
} = data;
|
} = data;
|
||||||
const fileYaml = `${workdir}${baseDirectory}${dockerComposeFileLocation}`;
|
const baseDir = `${workdir}${baseDirectory}`;
|
||||||
|
const envFile = `${baseDir}/.env`;
|
||||||
|
const fileYaml = `${baseDir}${dockerComposeFileLocation}`;
|
||||||
const dockerComposeRaw = await fs.readFile(fileYaml, 'utf8');
|
const dockerComposeRaw = await fs.readFile(fileYaml, 'utf8');
|
||||||
const dockerComposeYaml = yaml.load(dockerComposeRaw);
|
const dockerComposeYaml = yaml.load(dockerComposeRaw);
|
||||||
if (!dockerComposeYaml.services) {
|
if (!dockerComposeYaml.services) {
|
||||||
@@ -31,7 +33,7 @@ export default async function (data) {
|
|||||||
envs = [...envs, ...generateSecrets(secrets, pullmergeRequestId, false, null)];
|
envs = [...envs, ...generateSecrets(secrets, pullmergeRequestId, false, null)];
|
||||||
buildEnvs = [...buildEnvs, ...generateSecrets(secrets, pullmergeRequestId, true, null, true)];
|
buildEnvs = [...buildEnvs, ...generateSecrets(secrets, pullmergeRequestId, true, null, true)];
|
||||||
}
|
}
|
||||||
|
await fs.writeFile(envFile, envs.join('\n'));
|
||||||
const composeVolumes = [];
|
const composeVolumes = [];
|
||||||
if (volumes.length > 0) {
|
if (volumes.length > 0) {
|
||||||
for (const volume of volumes) {
|
for (const volume of volumes) {
|
||||||
@@ -50,19 +52,19 @@ export default async function (data) {
|
|||||||
if (value['env_file']) {
|
if (value['env_file']) {
|
||||||
delete value['env_file'];
|
delete value['env_file'];
|
||||||
}
|
}
|
||||||
|
value['env_file'] = [envFile];
|
||||||
|
|
||||||
let environment = typeof value['environment'] === 'undefined' ? [] : value['environment'];
|
// let environment = typeof value['environment'] === 'undefined' ? [] : value['environment'];
|
||||||
let finalEnvs = [...envs];
|
// let finalEnvs = [...envs];
|
||||||
if (Object.keys(environment).length > 0) {
|
// if (Object.keys(environment).length > 0) {
|
||||||
for (const arg of Object.keys(environment)) {
|
// for (const arg of Object.keys(environment)) {
|
||||||
const [key, _] = arg.split('=');
|
// const [key, _] = arg.split('=');
|
||||||
if (finalEnvs.filter((env) => env.startsWith(key)).length === 0) {
|
// if (finalEnvs.filter((env) => env.startsWith(key)).length === 0) {
|
||||||
finalEnvs.push(arg);
|
// finalEnvs.push(arg);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
// environment = Object.entries(environment).map(([key, value]) => `${key}=${value}`);
|
// }
|
||||||
}
|
// value['environment'] = [...finalEnvs];
|
||||||
value['environment'] = [...finalEnvs];
|
|
||||||
|
|
||||||
let build = typeof value['build'] === 'undefined' ? [] : value['build'];
|
let build = typeof value['build'] === 'undefined' ? [] : value['build'];
|
||||||
if (typeof build === 'string') {
|
if (typeof build === 'string') {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import { scheduler } from './scheduler';
|
|||||||
import type { ExecaChildProcess } from 'execa';
|
import type { ExecaChildProcess } from 'execa';
|
||||||
import { FastifyReply } from 'fastify';
|
import { FastifyReply } from 'fastify';
|
||||||
|
|
||||||
export const version = '3.12.36';
|
export const version = '3.12.37';
|
||||||
export const isDev = process.env.NODE_ENV === 'development';
|
export const isDev = process.env.NODE_ENV === 'development';
|
||||||
export const proxyPort = process.env.COOLIFY_PROXY_PORT;
|
export const proxyPort = process.env.COOLIFY_PROXY_PORT;
|
||||||
export const proxySecurePort = process.env.COOLIFY_PROXY_SECURE_PORT;
|
export const proxySecurePort = process.env.COOLIFY_PROXY_SECURE_PORT;
|
||||||
|
|||||||
@@ -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.12.36",
|
"version": "3.12.37",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": "github:coollabsio/coolify",
|
"repository": "github:coollabsio/coolify",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user