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
fix: add default node_env variable
Andras Bacsai93430e560763
diff --git a/apps/api/src/lib/buildPacks/compose.ts b/apps/api/src/lib/buildPacks/compose.tsindex 8b380247ce..229f449170 100644--- a/apps/api/src/lib/buildPacks/compose.ts+++ b/apps/api/src/lib/buildPacks/compose.ts@@ -25,7 +25,7 @@ export default async function (data) {if (!dockerComposeYaml.services) {throw 'No Services found in docker-compose file.';}- const envs = [];+ const envs = ['NODE_ENV=production'];if (secrets.length > 0) {secrets.forEach((secret) => {if (pullmergeRequestId) {diff --git a/apps/api/src/routes/api/v1/applications/handlers.ts b/apps/api/src/routes/api/v1/applications/handlers.tsindex c0399959ac..2d9acbd309 100644--- a/apps/api/src/routes/api/v1/applications/handlers.ts+++ b/apps/api/src/routes/api/v1/applications/handlers.ts@@ -461,7 +461,8 @@ export async function restartApplication(request: FastifyRequest<RestartApplicatconst { dockerRegistry, secrets, pullmergeRequestId, port, repository, persistentStorage, id: applicationId, buildPack, exposePort } = application;let location = null;const envs = [- `PORT=${port}`+ `PORT=${port}`,+ 'NODE_ENV=production'];if (secrets.length > 0) {secrets.forEach((secret) => {@@ -484,7 +485,7 @@ export async function restartApplication(request: FastifyRequest<RestartApplicat} else {if (!secret.isPRMRSecret) {if (secret.value.includes('\\n')|| secret.value.includes("'")) {- envs.push(`${secret.name}=${secret.value}`);+ envs.push(`${secret.name}=${secret.value}`);} else {envs.push(`${secret.name}='${secret.value}'`);}@@ -1175,7 +1176,8 @@ export async function restartPreview(request: FastifyRequest<RestartPreviewAppliconst { secrets, port, repository, persistentStorage, id: applicationId, buildPack, exposePort } = application;const envs = [- `PORT=${port}`+ `PORT=${port}`,+ 'NODE_ENV=production'];if (secrets.length > 0) {secrets.forEach((secret) => {diff --git a/apps/server/src/trpc/routers/applications/index.ts b/apps/server/src/trpc/routers/applications/index.tsindex bd27a8a47c..563f9fb12c 100644--- a/apps/server/src/trpc/routers/applications/index.ts+++ b/apps/server/src/trpc/routers/applications/index.ts@@ -203,7 +203,7 @@ export const applicationsRouter = router({let location = null;const labels = [];let image = null;- const envs = [`PORT=${port}`];+ const envs = [`PORT=${port}`, 'NODE_ENV=production'];if (secrets.length > 0) {secrets.forEach((secret) => {